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":
    my_op = 'Add'
    difficulty = str(raw_input("\tSelect a difficulty - Easy (E)(1-100), Medium (M) (1-200) or Hard (H) (1-500)"))
    print
    print "Addition"
    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

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

    # Input for answer
    answer = int(raw_input("Type in your answer: "))

    # 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.")

at the end of questions i want it show a "Certificate" that will be displayed showing:
a) the level chosen (easy, medium and hard)
b) the type of operation that was tested (Addition and Substraction)
c) the percentage they got correct (If they score 9 out of 10 then the percentage is 90%)
d) a comment (e.g. Needs Improvement)

You can print the variables named operation, difficulty, etc. You will have to declare them first before the if statements, otherwise they only exist within the if statement's code block.
print "\t\t\tWelcome to my Mathematics Game"
operation=""
difficulty=""

Also instead of
if difficulty == "Easy" or difficulty == "easy" or difficulty == "E" or difficulty == "e":
you can use
difficulty = difficulty.lower()
if difficulty.startswith("e"):
As long as there are no other words for difficulty that start with "e".

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.