Why is the following code giving me syntax error in line 5 ? Pls help | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Why is the following code giving me syntax error in line 5 ? Pls help

This is the code - { x = int(input()) print("level of uogrades: " + str(x)) if x <= 10 print("you are a normal player!") if 10 > x <= 50 print("hmm, you are grinding") if x > 100 print("man, go outside pls") }

28th Mar 2020, 4:19 AM
Ahsen Mirza
Ahsen Mirza - avatar
2 Answers
+ 3
Ahsen Mirza don't forget to add a colon ':' at the end of the if conditions. This will work fine, x = 5 if x <= 10: print("you are a normal player!")
28th Mar 2020, 4:23 AM
0_O-[Mägár_Sám_Äkà_Nüllpøïntêr_Èxëcéptïön]~~
0_O-[Mägár_Sám_Äkà_Nüllpøïntêr_Èxëcéptïön]~~ - avatar
+ 1
Thanks
28th Mar 2020, 4:24 AM
Ahsen Mirza
Ahsen Mirza - avatar