+ 3
How can the compiler know where the while block is ending.In C we have { } which define the scope of the variable.
What about python?
2 Respostas
+ 3
In python we indent.
a forever loop with while
x=0
While x<10:
print("part of the while statement")
print("This wont get executed since not indented")
x++
+ 3
we use indentation to Indicate the beginning and end of any loop. Thus, the compiler will know where the while block is ending