14 июля 2026
AbdurahmonHello, can someone explain me how to do it? I know it must be done with for loop nested inside for loop but how actually for loop inside another for loop works. I can’t even imagine it.
The main idea is that for the outer loop to control the rows while the inner loop the columns....u have 8 rows and 8 columns so use
for row in range(8): # Repeat for 8 rows
for column in range(8): # Print 8 "#" in this row
print("#", end=" ")
print() # Move to the next line
befikerThe main idea is that for the outer loop to control the rows while the inner loop the columns....u have 8 rows and 8 columns so use
for row in range(8): # Repeat for 8 rows
for column in range(8): # Print 8 "#" in this row
print("#", end=" ")
print() # Mo
What does “end” do? And I am still not sure how the hell am I supposed to translate for loop nested in for loop in my mind?
AbdurahmonWhat does “end” do? And I am still not sure how the hell am I supposed to translate for loop nested in for loop in my mind?
ends tell what to print after the value since default print() ends with a new line...as for nested loops...think of it as the outer loop repeats the rows... for each row, the inner loop repeats the columns...if you don't understand there are thousands of YouTube videos that explain it properly or ask goggle or ai