hey

well this program basically is a mathematics game...try the program out for yourself, it works, but im just wondering how to make an reset option so at the end of the program so the user can play the game again.

thanks

``````name = raw_input("\t\t\tPlease Enter Your Name: ")

print
print "\t\t\t\tHello", name
print "\t\t\tWelcome to my Mathematics Game"

# Selecting the operation of Addition and Substraction followed by the difficulty
print
operation = str(raw_input("\t\t\tAddition (A) or Substraction (S)"))
if operation == "A" or operation == "a":
difficulty = str(raw_input("\tSelect a difficulty - Easy (E)(1-100), Medium (M) (1-200) or Hard (H) (1-500)"))
print
print '** ** **'
print
elif operation == "S" or operation == "s":
my_op = 'Sub'
difficulty = str(raw_input("\tSelect a difficulty - Easy (E)(1-100), Medium (M) (1-200) or Hard (H) (1-500)"))
print
print "Subtraction"
print '** ** ** **'
print

if difficulty == "Easy" or difficulty == "easy" or difficulty == "E" or difficulty == "e":
my_rand_range = 100
elif difficulty == "Medium" or difficulty == "medium" or difficulty == "M" or difficulty == "m":
my_rand_range = 200
elif difficulty == "Hard" or difficulty == "hard" or difficulty == "H" or difficulty == "h":
my_rand_range = 500

# Amount of questions asked (10) and randomisation of numbers
import random
counter = 0
while counter < 10:
counter = counter +1

# Difficulty - Easy, Medium or Hard
number1 = random.randrange( my_rand_range ) + 1
number2 = random.randrange( my_rand_range ) + 1

print number1, "+", number2, "="
# Substraction Calculations
elif my_op == 'Sub':
print number1, "-", number2, "="

# If Its "Correct" or "Incorrect"
if ( answer == number1 + number2 and my_op == 'Add' ) or \
( answer == number1 - number2 and my_op == 'Sub' ):
print "Correct :)"
print
else:
print "Incorrect :("
print

raw_input("\n\nPress the enter key to exit.")``````

What you should do is rewrite your program and put it on a while loop so that when it ends it restarts by itself. Once you got that you should make a quit option and the program should work properly. Thus, your program will restart every time it ends and there will be an option to quit so they can stop the program. Here is an example of one of my programs look at the end of the program that’s where the while loop is located. Hopefully this helped you and good luck.