5 Antworten
+ 3
Because proper indentation is crucial in Python syntax. You have to indent expressions within the if statement.
+ 2
jesus! how i don't see it. really thank u, sorry about that...
+ 1
Check it out:
https://www.sololearn.com/learn/JUMP_LINK__&&__Python__&&__JUMP_LINK/2277
You should maintain the proper indentation throughout the whole code.
Within the if statement, you add four (or any other number, but it has to be consistent on the whole block) spaces before the instruction, like this example below:
if x=1:
print(x)
else:
print(x*2)
0
how I do that?
0
simply hit tab 🙂