Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import random
- no1 = random.randint (1,100)
- no2 = random.randint (1,100)
- eqdec = random.randint(1,4)
- if eqdec == 1:
- eq = "+"
- print ("What is", no1, eq, no2, "?")
- eqdone = (no1 + no2)
- print (eqdone)
- answer = input()
- if answer == eqdone:
- print ("Correct! Well Done!")
- else:
- print ("Wrong. Restart Program")
- if eqdec == 2:
- eq = "-"
- print ("What is", no1, eq, no2, "?")
- eqdone = (no1 - no2)
- print (eqdone)
- answer == input()
- if answer == eqdone:
- print ("Correct! Well Done!")
- else:
- print ("Wrong. Restart Program")
- if eqdec == 3:
- eq = "x"
- print ("What is", no1, eq, no2, "?")
- eqdone = (no1 * no2)
- print (eqdone)
- answer = input()
- if answer == eqdone:
- print ("Correct! Well Done!")
- else:
- print ("Wrong. Restart Program")
- if eqdec == 4:
- eq = "/"
- print ("What is", no1, eq, no2, "?")
- eqdone = (no1 / no2)
- print (eqdone)
- answer = input()
- if answer == eqdone:
- print ("Correct! Well Done!")
- else:
- print ("Wrong. Restart Program")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement