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 ()
4 odpowiedzi
+ 3
did you learned another programming language?
+ 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.
+ 1
For further reading (just read, not run):
https://code.sololearn.com/cT5BRIbkia21/?ref=app
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