0
Please check the coding.tell me step by step mistake in my coding i don't want the correct coding just the mistake step by step
4321 432 43 4 row = 4 while (row>=1): col=4 while (col>= 1): print (col, end=" ") col = col-1 row=row-1 print () I have correct coding data tell me my mistakes step by step
2 ответов
+ 4
indentation errors after while's
+ 1
Anton was right, need to work on the code indentation there, Python is strict about indentation.
I managed to get the desired output this way, put a little comment down there too. Ask away if you have any doubt 👍
The second while loop is the one that needs a little change once indentation problem is fixed.
row, n = 4 , 1 # <n> = lowest number
while (row >= 1):
col=4
while (col >= n): # <n> changes by each row
print (col, end = "")
col = col - 1
row = row - 1
n = n + 1
print ()