How does the code work even though the else statement is not aligned with the preceding if statement?
ret_code = -1
MAX_COUNT = 3
if ret_code < 0:
for i in range(MAX_COUNT-1):
print("sleep")
ret_code = 4
if ret_code >= 5:
break
else:
print(ret_code, '', 'Error')
Output is as follows:
Python 3.5.2 (default, Dec 2015, 13:05:11)
[GCC 4.8.2] on linux
sleep
sleep
4 Error
How does this work?