else & elif statements not working in Python

后端 未结 9 839
礼貌的吻别
礼貌的吻别 2020-12-10 11:06

I\'m a newbie to Python and currently learning Control Flow commands like if, else, etc.

The if statement is working all fine

9条回答
  •  囚心锁ツ
    2020-12-10 11:46

    indentation is important in Python. Your if else statement should be within triple arrow (>>>), In Mac python IDLE version 3.7.4 elif statement doesn't comes with correct indentation when you go on next line you have to shift left to avoid syntax error.

提交回复
热议问题