Advertisement
Guest User

Untitled

a guest
Jun 20th, 2018
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.27 KB | None | 0 0
  1. import random
  2.  
  3. cont = 1
  4. counter = 0
  5. correct  = 0
  6. incorrect = 0
  7.  
  8. lv = int(input("What  year are you[8][9]"))
  9.  
  10. while cont == 1 :
  11.     cont = 1
  12.     counter = 0
  13.     correct  = 0
  14.     incorrect = 0
  15.  
  16.     if (lv ==  8):
  17.         q1 = random.randint(1,50)
  18.         q2=random.randint(1,50)
  19.         ran = random.randint(1,2)
  20.        
  21.        
  22.     elif(lv == 9):
  23.         q1=random.randint(1,100)
  24.         q2=random.randint(1,100)
  25.         ran = random.randint(1,3)
  26.  
  27.  
  28.  
  29.     if ran == 1:
  30.         print("what is", q1 ,"+",q2)
  31.         true = (q1 + q2)
  32.  
  33.     elif ran == 2:
  34.         print("what is", q1 ,"-",q2)
  35.         true = (q1  - q2)
  36.  
  37.     elif ran == 3:
  38.         print("what is", q1 ,"*",q2)
  39.         true = (q1 * q2)
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.    
  51.        
  52.      #REMOVE FOR FINAL PROGRAM
  53.     print("Dev help",true)
  54.     ##REMOVE FOR FINAL PROGRAM
  55.     awn = float(input("Your awnser is:  "))
  56.    
  57.     counter += 1
  58.     if(true == awn):
  59.         print("Youre right")
  60.         correct += 1
  61.     else:
  62.         print("Incorrect")
  63.         incorrect += 1
  64.        
  65.     print(counter)
  66.     if (counter == 1):
  67.         print("You got",correct,"Correct and ",incorrect,"incorrect")
  68.         ta = input("Try agin?[Y][N]")
  69.         if (ta == "N"):
  70.                 exit()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement