hi again ive been lookin at this code that i found on the internet that test someones mathematical skills i have ironed out most of the errors but i cannot work out this one please help
the code is
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) \n\nPlease dont try medium or hard as they are still in progress"))
print
print "Addition"
print '** ** **'
print
if operation == "S" or operation == "s":
difficulty = str(raw_input("\tSelect a difficulty - Easy (E)(1-100), Medium (M) (1-200) or Hard (H) (1-500) \n\nPlease dont try medium or hard as they are still in progress"))
print
print "Subtraction"
print '** ** ** **'
print
# Amount of questions asked (10) and randomisation of numbers
import random
counter = 0
while counter < 10:
counter = counter +1
# Difficulty - Easy, Medium or Hard
if difficulty == "Easy" or difficulty == "easy" or difficulty == "E" or difficulty == "e":
number1 = random.randrange(100) + 1
number2 = random.randrange(100) + 1
elif difficulty == "Medium" or difficulty == "medium" or difficulty == "M" or difficulty == "m":
number3 = random.randrange(200) + 1
number4 = random.randrange(200) + 1
elif difficulty == "Hard" or difficulty == "hard" or difficulty == "H" or difficulty == "h":
number5 = random.randrange(500) + 1
number6 = random.randrange(500) + 1
# Addition Calculations
if operation == "A" or operation == "a":
if difficulty == "Easy" or difficulty == "easy" or difficulty == "E" or difficulty == "e":
print number1, "+", number2, "="
elif difficulty == "Medium" or difficulty == "medium" or difficulty == "M" or difficulty == "m":
print number3, "+", number4, "="
elif difficulty == "Hard" or difficulty == "hard" or difficulty == "H" or difficulty == "h":
print number5, "+", number6, "="
else:
# Substraction Calculations
if operation == "S" or operation == "s":
if difficulty == "Easy" or difficulty == "easy" or difficulty == "E" or difficulty == "e":
print number1, "-", number2, "="
elif difficulty == "Medium" or difficulty == "medium" or difficulty == "M" or difficulty == "m":
print number3, "-", number4, "="
else:
if difficulty == "Hard" or difficulty == "hard" or difficulty == "H" or difficulty == "h":
print number5, "-", number6, "="
# Input for answer
answer = int(raw_input("Type in your answer: "))
# If Its "Correct" or "Incorrect"
if (answer == number1+number2) or (answer == number3+number4) or (answer == number5+number6) or (answer == number1-number2) or (answer == number3-number4) or (answer == number5-number6):
print "Correct :)"
print
else:
print "Incorrect :("
print
print
raw_input("\n\nPress enter to exit.: ")
print
and the error was:
File "C:\Python25\3465.py", line 64, in ?
if (answer == number1+number2) or (answer == number3+number4) or (answer == number5+number6) or (answer == number1-number2) or (answer == number3-number4) or (answer == number5-number6):
NameError: name 'number3' is not defined