Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import random
- cont = 1
- counter = 0
- correct = 0
- incorrect = 0
- lv = int(input("What year are you[8][9]"))
- while cont == 1 :
- cont = 1
- counter = 0
- correct = 0
- incorrect = 0
- if (lv == 8):
- q1 = random.randint(1,50)
- q2=random.randint(1,50)
- ran = random.randint(1,2)
- elif(lv == 9):
- q1=random.randint(1,100)
- q2=random.randint(1,100)
- ran = random.randint(1,3)
- if ran == 1:
- print("what is", q1 ,"+",q2)
- true = (q1 + q2)
- elif ran == 2:
- print("what is", q1 ,"-",q2)
- true = (q1 - q2)
- elif ran == 3:
- print("what is", q1 ,"*",q2)
- true = (q1 * q2)
- #REMOVE FOR FINAL PROGRAM
- print("Dev help",true)
- ##REMOVE FOR FINAL PROGRAM
- awn = float(input("Your awnser is: "))
- counter += 1
- if(true == awn):
- print("Youre right")
- correct += 1
- else:
- print("Incorrect")
- incorrect += 1
- print(counter)
- if (counter == 1):
- print("You got",correct,"Correct and ",incorrect,"incorrect")
- ta = input("Try agin?[Y][N]")
- if (ta == "N"):
- exit()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement