Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- score=0#this mean your score is 0
- for i in range(10):#this means do the questins 10 times through
- import random#this means the question is random
- num1=random.randint(2,12)#the computer picks a number between 2,12 and puts it in num 1
- num2=random.randint(2,12)
- rightanswer=num1*num2#they give the right answer to num 1 times num2
- print(num1,"X",num2,"= ?")#the x means times the number and the ? that where you put the anwer
- choice=int(input("What is the answer?"))#you put the answer where it says whats the answer
- if rightanswer == choice:#if your choice is right
- print("Correct")#this means your answer is correct
- score=score+1#adds to your score +1
- else:
- print("Incorrect")#I think this means the answer is incorrect.
- print("Your score so far is",score)#shows your score and how well your doing
- print("Your score so far is",score,"out of 10")#shows your score out of ten
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement