0

There are indentation errors while using while statement (+1) in my coding.please explain why my coding is incorrect.

4321 432 43 4 Correct coding row = 1 while (row<=4): col=4 while (col>= row): print (col, end=" ") col = col-1 row=row+1 print () My coding row = 4 while (row>=1): col=4 while (col>= 1): print (col, end=" ") col = col-1 row=row-1 print ()

4th Sep 2019, 8:38 AM
Yash Garg
Yash Garg - avatar
4 odpowiedzi
+ 3
did you learned another programming language?
4th Sep 2019, 8:40 AM
ABADA S
ABADA S - avatar
+ 1
Hello, you have already posted this question here: https://www.sololearn.com/Discuss/1955582/please-check-the-coding-tell-me-step-by-step-mistake-in-my-coding-i-don-t-want-the-correct-coding Your code will be easier to correct if you share it in CodePlayground because we cannot properly see how you have written it here. EDIT: can you see how the 'correct' code is staggered? That is how you group lines of code together. Your 'while' statements are all on the same level, whereas the 'correct' code has the second 'while' statement nested inside the first one.
4th Sep 2019, 8:52 AM
Rincewind
Rincewind - avatar
+ 1
For further reading (just read, not run): https://code.sololearn.com/cT5BRIbkia21/?ref=app
4th Sep 2019, 10:11 AM
HonFu
HonFu - avatar
0
Remember: Python do not use brackets to identify execution blocks, but indentations (initial spaces or tabs). All statements having same indentation belong to the same block. After "while" a bigger indentation is mandatory
4th Sep 2019, 9:45 AM
Bilbo Baggins
Bilbo Baggins - avatar