jeudi 1 octobre 2015

working out maths questions made up of variables in python

import random
x random.randrange(11)
z= random.randrange(11)
y= random.choice('-+*')
print("what is?", x,y,z)
ans1=int(input())
if ans1== (x,y,z) :
    print("correct")
    score=score+1
else:
    print("incorrect,the answer is", x,y,z)

what is? 2 * 6

12

incorrect,the answer is 2 * 6




Aucun commentaire:

Enregistrer un commentaire