Am stuck in elif part ..help! | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
21st Jul 2018, 8:38 AM
Deesha Devi Raghu
Deesha Devi Raghu - avatar
5 Answers
+ 4
https://code.sololearn.com/cLzQERzpnbkC/?ref=app You indented elif and else wrongly. Edit: other things which I think are mistakes, fixed.
21st Jul 2018, 8:44 AM
Satyam
+ 6
if 10>5: print('10 greater than 5') print('program continues') x=6 if x==5: print("yes") elif x==6: print("it matches!!") else: print("program ended.") jest put if, elif and else statements in the same colomn then your code be fine
21st Jul 2018, 8:48 AM
estifanos
estifanos - avatar
+ 3
As estifanos tekiea pointed out, it's your indentation. Remember that Python uses indentation to control program flow instead of using brackets like most other languages.
21st Jul 2018, 12:04 PM
Duncan
Duncan - avatar
+ 3
thanks a lot guys for helping me😇
22nd Jul 2018, 9:44 AM
Deesha Devi Raghu
Deesha Devi Raghu - avatar
+ 1
you are welcome! Daya
22nd Jul 2018, 9:46 AM
Satyam