I need to write a program that asks if a random number is even or odd, the user inputs the answer and then the program tells you if it is correct or incorrect. I do not know what to put in ans=raw_input("is" [random number] "Odd or Even?")
this is what i have implemented right now, what do i do to fix it?
def evenOdd():
num=random.randrange(1,101)
ans=raw_input("is"+num+"even or odd?")
if ans % 2 == 0:
print "correct"
elif ans % 2 == 1:
print "incorrect"
Aucun commentaire:
Enregistrer un commentaire