Invalid Syntax message, no idea why
Sorry, i am a real newbie to coding, im trying to make an interactive
questionaire but it says that i have an invalid syntax on the if r == (w +
e) part, i am using python 33 and i have no idea what is wrong with it :S
import random
from time import sleep
win = 0
loss = 0
x =input("This is a test of wit, type your name to proceed: ")
print (x, '... An odd name... anyway, the test will now begin')
sleep(2)
q = input("Which is the odd one out - 10, 6, 3")
if q == '3':
print("Good, the test will continue")
win + 1
else:
print("fool, 3 is uneven, the rest are even")
loss - 1
print("Question 2, Let's test your maths skills")
w = random.randint(1,100)
e = random.randint(1,100)
print (w)
print (e)
t = int(w + e)
r = (input("Together these add to?")
if r == (w + e):
print("Well Done, you know your stuff..")
else:
print(w + e, "It's not hard...")
No comments:
Post a Comment