Facebook
From Maddy Adognon, 2 Years ago, written in Plain Text.
This paste is a reply to Untitled from Sexy Terrapin - view diff
Embed
Download Paste or View Raw
Hits: 88
  1. #Madeleine Adognon
  2.  
  3. import random
  4.  
  5. print("welcome to brain training")
  6. print("You will be asked 10 questions")
  7.  
  8. name = input("Enter your name : ")
  9. nick = input("What is your nickname? ")
  10.  
  11. print("OK ", name)
  12. print("But I will call you ", nick)
  13.  
  14. score = 0
  15.  
  16. num1 = random.randint(1,10)
  17. num2 = random.randint(1,5)
  18.  
  19. questionChoice = random.randint(1,3)
  20.  
  21. if questionChoice == 1:
  22.     print("Print to display the q")
  23.     computerAnswer = num1 + num2
  24.  
  25. if questionChoice == 2:
  26.     print("Print to display the q")
  27.     computerAnswer = num1 - num2
  28.  
  29. if questionChoice == 3:
  30.     print("Print to display the q")
  31.     computerAnswer = num1 * num2
  32.  
  33. print(num1 , " + " , num2 , " = ?")
  34. answer = input("What is your answer : ")
  35. int(answer)
  36.  
  37.  
  38. print("Your answer was ", answer)
  39.  
  40.  
  41. computerAnswer = num1 + num2
  42.  
  43. if answer == computerAnswer:
  44.     print("Correct!")
  45.     score = score + 1
  46. else:
  47.     print("Incorrect")
  48.    
  49.