0
How can we know the body of while is end there is no bracket to tell us?
4 Réponses
+ 3
By looking at the levels of indentation.
Statements within the same block of code need to be indented at the same level.
for i in range(42):
while True:
print(i)
break
print(42) # Same level of indentation as the while loop
+ 3
Something like this.
if n==0: # Level 0, no indentation
if n==1: # Level 1
if n==2: # Level 2
...
else: # Level 2
...
else: # Level 1
...
else: # Level 0
...
0
Level of indentation?
0
Thanks