0
What is wrong with this code? Please help; I'm a newbie
if 15<4: print ("lesser than four") elif 15<8: print ("lesser than eight") elif 15 <20: print ("lesser than twenty")
2 odpowiedzi
+ 1
In python, if, elif and else need to have the same indents, if they belong to the same if-statement. An if-statement works like this:
if #condition :
#do something
elif #condition :
#do something else
else:
#...
+ 1
Thanks a lot! I changed the code like you wrote and it worked! :)