+ 1
Why is the syntax wrong on line 17?
4 Answers
+ 4
u missed a closing brace above the else and in line 24 u cant start directly elif so remove that and type just if and u r good to go
+ 3
# Creator - Raphael Shay
# Upvote
import random
x = input()
y = random.randint(0, 10)
t = str(x) + str(y)
def problems():
if str(x) > str(10):
print(("Please input a 1 digit number."))
else:
print("You chose the number " + str(x) + ",")
print("the computer chose the number " + str(y) + ".")
problems()
def oddOrEven():
if int(t) % 2 == 0:
print("The number is even.")
elif int(t) % 2 == 1:
print("The number is odd")
oddOrEven()
+ 1
How can I code if i want to know about any number.
Is it possible If the only the last digit of a number (any length) is tried with no remainder and declared as even. else odd?