#Monica Ruiz #mathtraining.py #Create a program that shows an equation. #The user gets two chances to solve it, if they fail, the game's over #if they answer right the game continues showing more equations... import random #list variables num1 = random.randint(1, 100) num2 = random.randint(1, 100) add = num1 + num2 subt = num1 - num2 mult = num1 * num2 div = num1 / num2 #create equation answer = raw_input("What's your answer? ") print answer
Run
Reset
Share
Import
Link
Embed
Language▼
English
中文
Python Fiddle
Python Cloud IDE
Follow @python_fiddle
Browser Version Not Supported
Due to Python Fiddle's reliance on advanced JavaScript techniques, older browsers might have problems running it correctly. Please download the latest version of your favourite browser.
Chrome 10+
Firefox 4+
Safari 5+
IE 10+
Let me try anyway!
url:
Go
Python Snippet
Stackoverflow Question