Reputation: 39
Q = int(input("Enter a number."))
if Q > 30 and =< 40:
import easygui
easygui.msgbox("This number is greater than 30 and less than or equal to 40")
I don't know what's wrong it just says "Invalid Syntax"
and highlights the equal sign in equal to or less than 40
before even running the code. easygui
isn't the problem.
Upvotes: 1
Views: 721
Reputation: 4866
You probably meant to do this:
# v mention `Q` here
if Q > 30 and Q <= 40:
# ^ i.e. `<` before `=`
Upvotes: 4