+ 1
Syntax error
I writed the following code from the examples and saved it as test1.py: spam = 7 if spam > 5: print ("five") if spam > 8: print ("eight") after that I runed it python.3.6.4 Idle shell and I got the following error: expected an indanted block
3 Respostas
+ 2
indentation separate the block of code
ex: in this code if block need to be separated from rest of the code similar like { }brace usage in C language..
+ 1
in python the code in if/else statement must be indented, that means yoy have to put a TAB before it (or spaces)
if some:
dosomething()
not
if some:
dosomething()
0
just figured it out myself also "googled what indanted mens"
now it works
thanks for the quik answer