- 1
Why does this have invalid sintax
so i was messing around with one of the try it yourself codes from a lesson and wrote this grade = input('Enter : ') if(grade >= 70 and grade <= 100): print("Passed!") else: print("Failed") For some reason it says syntax error on the second line i dont understand
4 Answers
+ 2
Try it
grade = int(input('Enter : '))
0
yea its a type error but i dont know what i did wrong.
is it line spacing or an incorrect indent??
0
Input() will get an input string from the user .
If u want to compare it with a integer , you should first convert it to integer with int ( input() ) .
You didn't do that . That why it shows type error .