I have this code:
num = int(input("Enter a number: ")
if num%2 == 0:
print("The number is even")
else:
print("The number is odd")
Why do I get a syntax error on the if statement line?
I have this code:
num = int(input("Enter a number: ")
if num%2 == 0:
print("The number is even")
else:
print("The number is odd")
Why do I get a syntax error on the if statement line?
num = int(input("Enter a number: "))
if num%2 == 0:
print("The number is even")
else:
print("The number is odd")enter code here
Missing a ) on the line before. Lots of times when you get syntax errors on a line it happens at that line or a line or a few lines before that, in your case it's looking for a matching paren.