why is my code showing error | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

why is my code showing error

my intention is to give an input number and then print the statement https://code.sololearn.com/cBAhR7N8jxR8

4th Jun 2020, 7:23 AM
Gagandeep H S
Gagandeep H S - avatar
5 Answers
+ 6
AMOGHA. A. K., there is no syntax error in the code. There is a logical issue in the if statements.
4th Jun 2020, 10:23 AM
Lothar
Lothar - avatar
+ 4
spam = 7 if spam > 5: print("five") if spam > 8: print("eight") Also post the code in description through insert code option from next time
4th Jun 2020, 7:27 AM
Abhay
Abhay - avatar
+ 1
x=int(input('enter a number\n')) if x == 5: print('five') if x<5: print('not five')
4th Jun 2020, 8:54 AM
SAN
SAN - avatar
+ 1
Please try 😊😊
4th Jun 2020, 8:54 AM
SAN
SAN - avatar
0
oh sorry here is my code: https://code.sololearn.com/cBAhR7N8jxR8
4th Jun 2020, 7:43 AM
Gagandeep H S
Gagandeep H S - avatar