Advertisement
Guest User

Untitled

a guest
Nov 22nd, 2014
156
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.14 KB | None | 0 0
  1. import random
  2.  
  3. no1 = random.randint (1,100)
  4. no2 = random.randint (1,100)
  5. eqdec = random.randint(1,4)
  6.  
  7. if eqdec == 1:
  8. eq = "+"
  9. print ("What is", no1, eq, no2, "?")
  10. eqdone = (no1 + no2)
  11. print (eqdone)
  12. answer = input()
  13. if answer == eqdone:
  14. print ("Correct! Well Done!")
  15. else:
  16. print ("Wrong. Restart Program")
  17.  
  18. if eqdec == 2:
  19. eq = "-"
  20. print ("What is", no1, eq, no2, "?")
  21. eqdone = (no1 - no2)
  22. print (eqdone)
  23. answer == input()
  24. if answer == eqdone:
  25. print ("Correct! Well Done!")
  26. else:
  27. print ("Wrong. Restart Program")
  28.  
  29. if eqdec == 3:
  30. eq = "x"
  31. print ("What is", no1, eq, no2, "?")
  32. eqdone = (no1 * no2)
  33. print (eqdone)
  34. answer = input()
  35. if answer == eqdone:
  36. print ("Correct! Well Done!")
  37. else:
  38. print ("Wrong. Restart Program")
  39.  
  40. if eqdec == 4:
  41. eq = "/"
  42. print ("What is", no1, eq, no2, "?")
  43. eqdone = (no1 / no2)
  44. print (eqdone)
  45. answer = input()
  46. if answer == eqdone:
  47. print ("Correct! Well Done!")
  48. else:
  49. print ("Wrong. Restart Program")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement