Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import random
- score=0#what your score is
- for i in range(10):#tell the computure how many questionsto do
- num1=random.randint(2,12)#inputs a random number between 2 and 12
- num2=random.randint(2,12)
- rightanswer=num1*num2#it "x" the two random numbers to gether
- print(num1,"X",num2,"= ?")#it lets you type in the answer
- choice=int(input("What is the answer?"))
- if rightanswer == choice:
- print("Correct")#under the collculsion it will tell you if is's correct
- score=score+1#it will +1 point
- else:#if youtype in something eles it will do incorrect
- print("Incorrect")#under the collculsion it will tell you if is's incorrect
- print("your score is",score)#when you have done the collculasion it tells you your score after the collculsion
- print ("your final score is",score,"out of 10")#tells you what score is at the end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement