Hello, I just finished my "Who wants to be a millionaire Game", (very basic coding), but I got some issues when I click somewhere out of the Boxes range(try it), and I'd like to add some sort of points to each question, and as they go further make the question points go higher, but I don't know how to, can someone help me?

from graphics import *

win = GraphWin("Who wants to be a millionaire", 600, 400)
win.setBackground('Black')

## QUESTIONS FROM 1-15
def q1():
    
    centertxt = Point(300,100)
    label = Text(centertxt, "What is the largest animal ever to live on Earth?")
    label.setTextColor('White')
    label.draw(win)
    
    # Button 1
    a1center = Point(175,225)
    a1 = Rectangle(Point(100, 200),Point(250, 250))
    a1.setOutline('White')
    a1.draw(win)
    # Button 2
    a2center = Point(427,224)
    a2 = Rectangle(Point(350,200), Point(500,250))
    a2.setOutline('White')
    a2.draw(win)
    # Button 3
    a3center = Point(174,326)
    a3 = Rectangle(Point(350,300), Point(500,350))
    a3.setOutline('White')
    a3.draw(win)
    # Button 4
    a4center = Point(425,325)
    a4 = Rectangle(Point(100,300), Point(250,350))
    a4.setOutline('White')
    a4.draw(win)

    #Answer 1
    label1 = Text(a1center, "Blue Whale")
    label1.setTextColor('White')
    label1.draw(win)
    #Answer 2
    label2 = Text(a2center, "Chicken")
    label2.setTextColor('White')
    label2.draw(win)
    #Answer 3
    label3 = Text(a3center, "Shark")
    label3.setTextColor('White')
    label3.draw(win)
    #Answer 4
    label4 = Text(a4center, "Elephant")
    label4.setTextColor('White')
    label4.draw(win)

    p = win.getMouse()
    #First Possible Answer
    if p.getX() >= 103 and p.getX() <= 246 and p.getY() >= 202 and p.getY() <= 246:
        label.undraw()
        a1.undraw()
        a2.undraw()
        a3.undraw()
        a4.undraw()
        label1.undraw()
        label2.undraw()
        label3.undraw()
        label4.undraw()
        
        # CORRECT ANSWER
        center = Point(300,200)
        congrats = Text(center, "CORRECT!!!")
        congrats.setTextColor('White')
        congrats.setSize(30)
        congrats.draw(win)

        #Next Question Button
        SRect = Rectangle(Point(220,250),Point(400,300))
        SRect.draw(win)
        SRect.setOutline('White')
        centerstart = Point(310,275)
        stxt = Text(centerstart, "Next Question >>")
        stxt.setSize(12)
        stxt.setStyle('bold')
        stxt.setTextColor('White')
        stxt.draw(win)
        #Wait for Mouse Click to go to next Question
        win.getMouse()
        congrats.undraw()
        SRect.undraw()
        stxt.undraw()
        q2()
        

        
    #Second Possible Answer
    elif p.getX() >= 353 and p.getX() <= 496 and p.getY() >= 201 and p.getY() <= 245:
        label.undraw()
        a1.undraw()
        a2.undraw()
        a3.undraw()
        a4.undraw()
        label1.undraw()
        label2.undraw()
        label3.undraw()
        label4.undraw()

        #WRONG ANSWER
        center2 = Point(300,60)
        bu = Text(center2, "WRONG ANSWER !! BUUU!")
        bu.setTextColor('White')
        bu.setSize(30)
        bu.draw(win)
        #Restart Button
        SRect = Rectangle(Point(220,250),Point(400,300))
        SRect.draw(win)
        SRect.setOutline('White')
        centerstart = Point(310,275)
        stxt = Text(centerstart, "RESTART")
        stxt.setSize(18)
        stxt.setStyle('bold')
        stxt.setTextColor('White')
        stxt.draw(win)
        #Wait for Mouse Click to Restart Game
        win.getMouse()
        bu.undraw()
        SRect.undraw()
        stxt.undraw()
        main()
                   
    #Third Possible Asnwer
    elif p.getX() >= 104 and p.getX() <= 245 and p.getY() >= 302 and p.getY() <= 344:
        label.undraw()
        a1.undraw()
        a2.undraw()
        a3.undraw()
        a4.undraw()
        label1.undraw()
        label2.undraw()
        label3.undraw()
        label4.undraw()
        #WRONG ANSWER
        center2 = Point(300,60)
        bu = Text(center2, "WRONG ANSWER !! BUUU!")
        bu.setTextColor('White')
        bu.setSize(30)
        bu.draw(win)
        #Restart Button
        SRect = Rectangle(Point(220,250),Point(400,300))
        SRect.draw(win)
        SRect.setOutline('White')
        centerstart = Point(310,275)
        stxt = Text(centerstart, "RESTART")
        stxt.setSize(18)
        stxt.setStyle('bold')
        stxt.setTextColor('White')
        stxt.draw(win)
        #Wait for Mouse Click to Restart Game
        win.getMouse()
        bu.undraw()
        SRect.undraw()
        stxt.undraw()
        main()
    #Fourth Possible Answer
    elif p.getX() >= 353 and p.getX() <= 494 and p.getY() >= 303 and p.getY() <= 346:
        label.undraw()
        a1.undraw()
        a2.undraw()
        a3.undraw()
        a4.undraw()
        label1.undraw()
        label2.undraw()
        label3.undraw()
        label4.undraw()

        #WRONG ANSWER
        center2 = Point(300,60)
        bu = Text(center2, "WRONG ANSWER !! BUUU!")
        bu.setTextColor('White')
        bu.setSize(30)
        bu.draw(win)
        #Restart Button
        SRect = Rectangle(Point(220,250),Point(400,300))
        SRect.draw(win)
        SRect.setOutline('White')
        centerstart = Point(310,275)
        stxt = Text(centerstart, "RESTART")
        stxt.setSize(18)
        stxt.setStyle('bold')
        stxt.setTextColor('White')
        stxt.draw(win)
        #Wait for Mouse Click to Restart Game
        win.getMouse()
        bu.undraw()
        SRect.undraw()
        stxt.undraw()
        main()

def q2():
    centertxt = Point(300,100)
    label = Text(centertxt, "Which of these animals shares its name with a luxury car?")
    label.setTextColor('White')
    label.draw(win)
    
    # Button 1
    a1center = Point(175,225)
    a1 = Rectangle(Point(100, 200),Point(250, 250))
    a1.setOutline('White')
    a1.draw(win)
    # Button 2
    a2center = Point(427,224)
    a2 = Rectangle(Point(350,200), Point(500,250))
    a2.setOutline('White')
    a2.draw(win)
    # Button 3
    a3center = Point(174,326)
    a3 = Rectangle(Point(350,300), Point(500,350))
    a3.setOutline('White')
    a3.draw(win)
    # Button 4
    a4center = Point(425,325)
    a4 = Rectangle(Point(100,300), Point(250,350))
    a4.setOutline('White')
    a4.draw(win)

    #Answer 1
    label1 = Text(a1center, "Star")
    label1.setTextColor('White')
    label1.draw(win)
    #Answer 2
    label2 = Text(a2center, "Jaguar")
    label2.setTextColor('White')
    label2.draw(win)
    #Answer 3
    label3 = Text(a3center, "Ryno")
    label3.setTextColor('White')
    label3.draw(win)
    #Answer 4
    label4 = Text(a4center, "Eagle")
    label4.setTextColor('White')
    label4.draw(win)

    p = win.getMouse()
    #First Possible Answer
    if p.getX() >= 103 and p.getX() <= 246 and p.getY() >= 202 and p.getY() <= 246:
        label.undraw()
        a1.undraw()
        a2.undraw()
        a3.undraw()
        a4.undraw()
        label1.undraw()
        label2.undraw()
        label3.undraw()
        label4.undraw()
        #WRONG ANSWER
        center2 = Point(300,60)
        bu = Text(center2, "WRONG ANSWER !! BUUU!")
        bu.setTextColor('White')
        bu.setSize(30)
        bu.draw(win)
        #Restart Button
        SRect = Rectangle(Point(220,250),Point(400,300))
        SRect.draw(win)
        SRect.setOutline('White')
        centerstart = Point(310,275)
        stxt = Text(centerstart, "RESTART")
        stxt.setSize(18)
        stxt.setStyle('bold')
        stxt.setTextColor('White')
        stxt.draw(win)
        #Wait for Mouse Click to Restart Game
        win.getMouse()
        bu.undraw()
        SRect.undraw()
        stxt.undraw()
        main()
        
        
      
    #Second Possible Answer
    elif p.getX() >= 353 and p.getX() <= 496 and p.getY() >= 201 and p.getY() <= 245:
        label.undraw()
        a1.undraw()
        a2.undraw()
        a3.undraw()
        a4.undraw()
        label1.undraw()
        label2.undraw()
        label3.undraw()
        label4.undraw()
        # CORRECT ANSWER
        center = Point(300,200)
        congrats = Text(center, "CORRECT!!!")
        congrats.setTextColor('White')
        congrats.setSize(30)
        congrats.draw(win)

        #Next Question Button
        SRect = Rectangle(Point(220,250),Point(400,300))
        SRect.draw(win)
        SRect.setOutline('White')
        centerstart = Point(310,275)
        stxt = Text(centerstart, "Next Question >>")
        stxt.setSize(12)
        stxt.setStyle('bold')
        stxt.setTextColor('White')
        stxt.draw(win)
        #Wait for Mouse Click to go to next Question
        win.getMouse()
        congrats.undraw()
        SRect.undraw()
        stxt.undraw()
        q3()
        
        
                   
    #Third Possible Asnwer
    elif p.getX() >= 104 and p.getX() <= 245 and p.getY() >= 302 and p.getY() <= 344:
        label.undraw()
        a1.undraw()
        a2.undraw()
        a3.undraw()
        a4.undraw()
        label1.undraw()
        label2.undraw()
        label3.undraw()
        label4.undraw()
        #WRONG ANSWER
        center2 = Point(300,60)
        bu = Text(center2, "WRONG ANSWER !! BUUU!")
        bu.setTextColor('White')
        bu.setSize(30)
        bu.draw(win)
        #Restart Button
        SRect = Rectangle(Point(220,250),Point(400,300))
        SRect.draw(win)
        SRect.setOutline('White')
        centerstart = Point(310,275)
        stxt = Text(centerstart, "RESTART")
        stxt.setSize(18)
        stxt.setStyle('bold')
        stxt.setTextColor('White')
        stxt.draw(win)
        #Wait for Mouse Click to Restart Game
        win.getMouse()
        bu.undraw()
        SRect.undraw()
        stxt.undraw()
        main()
    #Fourth Possible Answer
    elif p.getX() >= 353 and p.getX() <= 494 and p.getY() >= 303 and p.getY() <= 346:
        label.undraw()
        a1.undraw()
        a2.undraw()
        a3.undraw()
        a4.undraw()
        label1.undraw()
        label2.undraw()
        label3.undraw()
        label4.undraw()

        #WRONG ANSWER
        center2 = Point(300,60)
        bu = Text(center2, "WRONG ANSWER !! BUUU!")
        bu.setTextColor('White')
        bu.setSize(30)
        bu.draw(win)
        #Restart Button
        SRect = Rectangle(Point(220,250),Point(400,300))
        SRect.draw(win)
        SRect.setOutline('White')
        centerstart = Point(310,275)
        stxt = Text(centerstart, "RESTART")
        stxt.setSize(18)
        stxt.setStyle('bold')
        stxt.setTextColor('White')
        stxt.draw(win)
        #Wait for Mouse Click to Restart Game
        win.getMouse()
        bu.undraw()
        SRect.undraw()
        stxt.undraw()
        main()
def q3():
    
    centertxt = Point(300,100)
    label = Text(centertxt, "What sport is known as ''The Sport of Kings''?")
    label.setTextColor('White')
    label.draw(win)
    
    # Button 1
    a1center = Point(175,225)
    a1 = Rectangle(Point(100, 200),Point(250, 250))
    a1.setOutline('White')
    a1.draw(win)
    # Button 2
    a2center = Point(427,224)
    a2 = Rectangle(Point(350,200), Point(500,250))
    a2.setOutline('White')
    a2.draw(win)
    # Button 3
    a3center = Point(174,326)
    a3 = Rectangle(Point(350,300), Point(500,350))
    a3.setOutline('White')
    a3.draw(win)
    # Button 4
    a4center = Point(425,325)
    a4 = Rectangle(Point(100,300), Point(250,350))
    a4.setOutline('White')
    a4.draw(win)

    #Answer 1
    label1 = Text(a1center, "Horse Racing")
    label1.setTextColor('White')
    label1.draw(win)
    #Answer 2
    label2 = Text(a2center, "Football")
    label2.setTextColor('White')
    label2.draw(win)
    #Answer 3
    label3 = Text(a3center, "Soccer")
    label3.setTextColor('White')
    label3.draw(win)
    #Answer 4
    label4 = Text(a4center, "Motocross")
    label4.setTextColor('White')
    label4.draw(win)

    p = win.getMouse()
    #First Possible Answer
    if p.getX() >= 103 and p.getX() <= 246 and p.getY() >= 202 and p.getY() <= 246:
        label.undraw()
        a1.undraw()
        a2.undraw()
        a3.undraw()
        a4.undraw()
        label1.undraw()
        label2.undraw()
        label3.undraw()
        label4.undraw()
        
        # CORRECT ANSWER
        center = Point(300,200)
        congrats = Text(center, "CORRECT!!!")
        congrats.setTextColor('White')
        congrats.setSize(30)
        congrats.draw(win)

        #Next Question Button
        SRect = Rectangle(Point(220,250),Point(400,300))
        SRect.draw(win)
        SRect.setOutline('White')
        centerstart = Point(310,275)
        stxt = Text(centerstart, "Next Question >>")
        stxt.setSize(12)
        stxt.setStyle('bold')
        stxt.setTextColor('White')
        stxt.draw(win)
        #Wait for Mouse Click to go to next Question
        win.getMouse()
        congrats.undraw()
        SRect.undraw()
        stxt.undraw()
        q4()
        

        
    #Second Possible Answer
    elif p.getX() >= 353 and p.getX() <= 496 and p.getY() >= 201 and p.getY() <= 245:
        label.undraw()
        a1.undraw()
        a2.undraw()
        a3.undraw()
        a4.undraw()
        label1.undraw()
        label2.undraw()
        label3.undraw()
        label4.undraw()

        #WRONG ANSWER
        center2 = Point(300,60)
        bu = Text(center2, "WRONG ANSWER !! BUUU!")
        bu.setTextColor('White')
        bu.setSize(30)
        bu.draw(win)
        #Restart Button
        SRect = Rectangle(Point(220,250),Point(400,300))
        SRect.draw(win)
        SRect.setOutline('White')
        centerstart = Point(310,275)
        stxt = Text(centerstart, "RESTART")
        stxt.setSize(18)
        stxt.setStyle('bold')
        stxt.setTextColor('White')
        stxt.draw(win)
        #Wait for Mouse Click to Restart Game
        win.getMouse()
        bu.undraw()
        SRect.undraw()
        stxt.undraw()
        main()
                   
    #Third Possible Asnwer
    elif p.getX() >= 104 and p.getX() <= 245 and p.getY() >= 302 and p.getY() <= 344:
        label.undraw()
        a1.undraw()
        a2.undraw()
        a3.undraw()
        a4.undraw()
        label1.undraw()
        label2.undraw()
        label3.undraw()
        label4.undraw()
        #WRONG ANSWER
        center2 = Point(300,60)
        bu = Text(center2, "WRONG ANSWER !! BUUU!")
        bu.setTextColor('White')
        bu.setSize(30)
        bu.draw(win)
        #Restart Button
        SRect = Rectangle(Point(220,250),Point(400,300))
        SRect.draw(win)
        SRect.setOutline('White')
        centerstart = Point(310,275)
        stxt = Text(centerstart, "RESTART")
        stxt.setSize(18)
        stxt.setStyle('bold')
        stxt.setTextColor('White')
        stxt.draw(win)
        #Wait for Mouse Click to Restart Game
        win.getMouse()
        bu.undraw()
        SRect.undraw()
        stxt.undraw()
        main()
    #Fourth Possible Answer
    elif p.getX() >= 353 and p.getX() <= 494 and p.getY() >= 303 and p.getY() <= 346:
        label.undraw()
        a1.undraw()
        a2.undraw()
        a3.undraw()
        a4.undraw()
        label1.undraw()
        label2.undraw()
        label3.undraw()
        label4.undraw()

        #WRONG ANSWER
        center2 = Point(300,60)
        bu = Text(center2, "WRONG ANSWER !! BUUU!")
        bu.setTextColor('White')
        bu.setSize(30)
        bu.draw(win)
        #Restart Button
        SRect = Rectangle(Point(220,250),Point(400,300))
        SRect.draw(win)
        SRect.setOutline('White')
        centerstart = Point(310,275)
        stxt = Text(centerstart, "RESTART")
        stxt.setSize(18)
        stxt.setStyle('bold')
        stxt.setTextColor('White')
        stxt.draw(win)
        #Wait for Mouse Click to Restart Game
        win.getMouse()
        bu.undraw()
        SRect.undraw()
        stxt.undraw()
        main()
    
def q4():
    
    centertxt = Point(300,100)
    label = Text(centertxt, "In baseball, how many ball make a walk?")
    label.setTextColor('White')
    label.draw(win)
    
    # Button 1
    a1center = Point(175,225)
    a1 = Rectangle(Point(100, 200),Point(250, 250))
    a1.setOutline('White')
    a1.draw(win)
    # Button 2
    a2center = Point(427,224)
    a2 = Rectangle(Point(350,200), Point(500,250))
    a2.setOutline('White')
    a2.draw(win)
    # Button 3
    a3center = Point(174,326)
    a3 = Rectangle(Point(350,300), Point(500,350))
    a3.setOutline('White')
    a3.draw(win)
    # Button 4
    a4center = Point(425,325)
    a4 = Rectangle(Point(100,300), Point(250,350))
    a4.setOutline('White')
    a4.draw(win)

    #Answer 1
    label1 = Text(a1center, "3")
    label1.setTextColor('White')
    label1.draw(win)
    #Answer 2
    label2 = Text(a2center, "5")
    label2.setTextColor('White')
    label2.draw(win)
    #Answer 3
    label3 = Text(a3center, "2")
    label3.setTextColor('White')
    label3.draw(win)
    #Answer 4
    label4 = Text(a4center, "4")
    label4.setTextColor('White')
    label4.draw(win)

    p = win.getMouse()
    #First Possible Answer
    if p.getX() >= 103 and p.getX() <= 246 and p.getY() >= 202 and p.getY() <= 246:
        label.undraw()
        a1.undraw()
        a2.undraw()
        a3.undraw()
        a4.undraw()
        label1.undraw()
        label2.undraw()
        label3.undraw()
        label4.undraw()

        #WRONG ANSWER
        center2 = Point(300,60)
        bu = Text(center2, "WRONG ANSWER !! BUUU!")
        bu.setTextColor('White')
        bu.setSize(30)
        bu.draw(win)
        #Restart Button
        SRect = Rectangle(Point(220,250),Point(400,300))
        SRect.draw(win)
        SRect.setOutline('White')
        centerstart = Point(310,275)
        stxt = Text(centerstart, "RESTART")
        stxt.setSize(18)
        stxt.setStyle('bold')
        stxt.setTextColor('White')
        stxt.draw(win)
        #Wait for Mouse Click to Restart Game
        win.getMouse()
        bu.undraw()
        SRect.undraw()
        stxt.undraw()
        main()
        
    #Second Possible Answer
    elif p.getX() >= 353 and p.getX() <= 496 and p.getY() >= 201 and p.getY() <= 245:
        label.undraw()
        a1.undraw()
        a2.undraw()
        a3.undraw()
        a4.undraw()
        label1.undraw()
        label2.undraw()
        label3.undraw()
        label4.undraw()

        #WRONG ANSWER
        center2 = Point(300,60)
        bu = Text(center2, "WRONG ANSWER !! BUUU!")
        bu.setTextColor('White')
        bu.setSize(30)
        bu.draw(win)
        #Restart Button
        SRect = Rectangle(Point(220,250),Point(400,300))
        SRect.draw(win)
        SRect.setOutline('White')
        centerstart = Point(310,275)
        stxt = Text(centerstart, "RESTART")
        stxt.setSize(18)
        stxt.setStyle('bold')
        stxt.setTextColor('White')
        stxt.draw(win)
        #Wait for Mouse Click to Restart Game
        win.getMouse()
        bu.undraw()
        SRect.undraw()
        stxt.undraw()
        main()
                   
    #Third Possible Asnwer
    elif p.getX() >= 104 and p.getX() <= 245 and p.getY() >= 302 and p.getY() <= 344:
        label.undraw()
        a1.undraw()
        a2.undraw()
        a3.undraw()
        a4.undraw()
        label1.undraw()
        label2.undraw()
        label3.undraw()
        label4.undraw()
        #WRONG ANSWER
        center2 = Point(300,60)
        bu = Text(center2, "WRONG ANSWER !! BUUU!")
        bu.setTextColor('White')
        bu.setSize(30)
        bu.draw(win)
        #Restart Button
        SRect = Rectangle(Point(220,250),Point(400,300))
        SRect.draw(win)
        SRect.setOutline('White')
        centerstart = Point(310,275)
        stxt = Text(centerstart, "RESTART")
        stxt.setSize(18)
        stxt.setStyle('bold')
        stxt.setTextColor('White')
        stxt.draw(win)
        #Wait for Mouse Click to Restart Game
        win.getMouse()
        bu.undraw()
        SRect.undraw()
        stxt.undraw()
        main()
    #Fourth Possible Answer
    elif p.getX() >= 353 and p.getX() <= 494 and p.getY() >= 303 and p.getY() <= 346:
        label.undraw()
        a1.undraw()
        a2.undraw()
        a3.undraw()
        a4.undraw()
        label1.undraw()
        label2.undraw()
        label3.undraw()
        label4.undraw()
         # CORRECT ANSWER
        center = Point(300,200)
        congrats = Text(center, "CORRECT!!!")
        congrats.setTextColor('White')
        congrats.setSize(30)
        congrats.draw(win)

        #Next Question Button
        SRect = Rectangle(Point(220,250),Point(400,300))
        SRect.draw(win)
        SRect.setOutline('White')
        centerstart = Point(310,275)
        stxt = Text(centerstart, "Next Question >>")
        stxt.setSize(12)
        stxt.setStyle('bold')
        stxt.setTextColor('White')
        stxt.draw(win)
        #Wait for Mouse Click to go to next Question
        win.getMouse()
        congrats.undraw()
        SRect.undraw()
        stxt.undraw()
        q5()
def q5():
    
    centertxt = Point(300,100)
    label = Text(centertxt, "Where is fireworks first known to have been develop?")
    label.setTextColor('White')
    label.draw(win)
    
    # Button 1
    a1center = Point(175,225)
    a1 = Rectangle(Point(100, 200),Point(250, 250))
    a1.setOutline('White')
    a1.draw(win)
    # Button 2
    a2center = Point(427,224)
    a2 = Rectangle(Point(350,200), Point(500,250))
    a2.setOutline('White')
    a2.draw(win)
    # Button 3
    a3center = Point(174,326)
    a3 = Rectangle(Point(350,300), Point(500,350))
    a3.setOutline('White')
    a3.draw(win)
    # Button 4
    a4center = Point(425,325)
    a4 = Rectangle(Point(100,300), Point(250,350))
    a4.setOutline('White')
    a4.draw(win)

    #Answer 1
    label1 = Text(a1center, "China")
    label1.setTextColor('White')
    label1.draw(win)
    #Answer 2
    label2 = Text(a2center, "USA")
    label2.setTextColor('White')
    label2.draw(win)
    #Answer 3
    label3 = Text(a3center, "Russia")
    label3.setTextColor('White')
    label3.draw(win)
    #Answer 4
    label4 = Text(a4center, "England")
    label4.setTextColor('White')
    label4.draw(win)

    p = win.getMouse()
    #First Possible Answer
    if p.getX() >= 103 and p.getX() <= 246 and p.getY() >= 202 and p.getY() <= 246:
        label.undraw()
        a1.undraw()
        a2.undraw()
        a3.undraw()
        a4.undraw()
        label1.undraw()
        label2.undraw()
        label3.undraw()
        label4.undraw()
        
        # CORRECT ANSWER
        center = Point(300,200)
        congrats = Text(center, "CORRECT!!!")
        congrats.setTextColor('White')
        congrats.setSize(30)
        congrats.draw(win)

        #Next Question Button
        SRect = Rectangle(Point(220,250),Point(400,300))
        SRect.draw(win)
        SRect.setOutline('White')
        centerstart = Point(310,275)
        stxt = Text(centerstart, "Next Question >>")
        stxt.setSize(12)
        stxt.setStyle('bold')
        stxt.setTextColor('White')
        stxt.draw(win)
        #Wait for Mouse Click to go to next Question
        win.getMouse()
        congrats.undraw()
        SRect.undraw()
        stxt.undraw()
        q6()
        

        
    #Second Possible Answer
    elif p.getX() >= 353 and p.getX() <= 496 and p.getY() >= 201 and p.getY() <= 245:
        label.undraw()
        a1.undraw()
        a2.undraw()
        a3.undraw()
        a4.undraw()
        label1.undraw()
        label2.undraw()
        label3.undraw()
        label4.undraw()

        #WRONG ANSWER
        center2 = Point(300,60)
        bu = Text(center2, "WRONG ANSWER !! BUUU!")
        bu.setTextColor('White')
        bu.setSize(30)
        bu.draw(win)
        #Restart Button
        SRect = Rectangle(Point(220,250),Point(400,300))
        SRect.draw(win)
        SRect.setOutline('White')
        centerstart = Point(310,275)
        stxt = Text(centerstart, "RESTART")
        stxt.setSize(18)
        stxt.setStyle('bold')
        stxt.setTextColor('White')
        stxt.draw(win)
        #Wait for Mouse Click to Restart Game
        win.getMouse()
        bu.undraw()
        SRect.undraw()
        stxt.undraw()
        main()
                   
    #Third Possible Asnwer
    elif p.getX() >= 104 and p.getX() <= 245 and p.getY() >= 302 and p.getY() <= 344:
        label.undraw()
        a1.undraw()
        a2.undraw()
        a3.undraw()
        a4.undraw()
        label1.undraw()
        label2.undraw()
        label3.undraw()
        label4.undraw()
        #WRONG ANSWER
        center2 = Point(300,60)
        bu = Text(center2, "WRONG ANSWER !! BUUU!")
        bu.setTextColor('White')
        bu.setSize(30)
        bu.draw(win)
        #Restart Button
        SRect = Rectangle(Point(220,250),Point(400,300))
        SRect.draw(win)
        SRect.setOutline('White')
        centerstart = Point(310,275)
        stxt = Text(centerstart, "RESTART")
        stxt.setSize(18)
        stxt.setStyle('bold')
        stxt.setTextColor('White')
        stxt.draw(win)
        #Wait for Mouse Click to Restart Game
        win.getMouse()
        bu.undraw()
        SRect.undraw()
        stxt.undraw()
        main()
    #Fourth Possible Answer
    elif p.getX() >= 353 and p.getX() <= 494 and p.getY() >= 303 and p.getY() <= 346:
        label.undraw()
        a1.undraw()
        a2.undraw()
        a3.undraw()
        a4.undraw()
        label1.undraw()
        label2.undraw()
        label3.undraw()
        label4.undraw()

        #WRONG ANSWER
        center2 = Point(300,60)
        bu = Text(center2, "WRONG ANSWER !! BUUU!")
        bu.setTextColor('White')
        bu.setSize(30)
        bu.draw(win)
        #Restart Button
        SRect = Rectangle(Point(220,250),Point(400,300))
        SRect.draw(win)
        SRect.setOutline('White')
        centerstart = Point(310,275)
        stxt = Text(centerstart, "RESTART")
        stxt.setSize(18)
        stxt.setStyle('bold')
        stxt.setTextColor('White')
        stxt.draw(win)
        #Wait for Mouse Click to Restart Game
        win.getMouse()
        bu.undraw()
        SRect.undraw()
        stxt.undraw()
        main()

def q6():
    
    centertxt = Point(300,100)
    label = Text(centertxt, "What is the correct spelling of New Mexico's largest city?")
    label.setTextColor('White')
    label.draw(win)
    
    # Button 1
    a1center = Point(175,225)
    a1 = Rectangle(Point(100, 200),Point(250, 250))
    a1.setOutline('White')
    a1.draw(win)
    # Button 2
    a2center = Point(427,224)
    a2 = Rectangle(Point(350,200), Point(500,250))
    a2.setOutline('White')
    a2.draw(win)
    # Button 3
    a3center = Point(174,326)
    a3 = Rectangle(Point(350,300), Point(500,350))
    a3.setOutline('White')
    a3.draw(win)
    # Button 4
    a4center = Point(425,325)
    a4 = Rectangle(Point(100,300), Point(250,350))
    a4.setOutline('White')
    a4.draw(win)

    #Answer 1
    label1 = Text(a1center, "Albuquerquue")
    label1.setTextColor('White')
    label1.draw(win)
    #Answer 2
    label2 = Text(a2center, "Albuqerque")
    label2.setTextColor('White')
    label2.draw(win)
    #Answer 3
    label3 = Text(a3center, "Albuquerque")
    label3.setTextColor('White')
    label3.draw(win)
    #Answer 4
    label4 = Text(a4center, "Albeuquerque")
    label4.setTextColor('White')
    label4.draw(win)

    p = win.getMouse()
    #First Possible Answer
    if p.getX() >= 103 and p.getX() <= 246 and p.getY() >= 202 and p.getY() <= 246:
        label.undraw()
        a1.undraw()
        a2.undraw()
        a3.undraw()
        a4.undraw()
        label1.undraw()
        label2.undraw()
        label3.undraw()
        label4.undraw()

        #WRONG ANSWER
        center2 = Point(300,60)
        bu = Text(center2, "WRONG ANSWER !! BUUU!")
        bu.setTextColor('White')
        bu.setSize(30)
        bu.draw(win)
        #Restart Button
        SRect = Rectangle(Point(220,250),Point(400,300))
        SRect.draw(win)
        SRect.setOutline('White')
        centerstart = Point(310,275)
        stxt = Text(centerstart, "RESTART")
        stxt.setSize(18)
        stxt.setStyle('bold')
        stxt.setTextColor('White')
        stxt.draw(win)
        #Wait for Mouse Click to Restart Game
        win.getMouse()
        bu.undraw()
        SRect.undraw()
        stxt.undraw()
        main()
        
        
        

        
    #Second Possible Answer
    elif p.getX() >= 353 and p.getX() <= 496 and p.getY() >= 201 and p.getY() <= 245:
        label.undraw()
        a1.undraw()
        a2.undraw()
        a3.undraw()
        a4.undraw()
        label1.undraw()
        label2.undraw()
        label3.undraw()
        label4.undraw()

        #WRONG ANSWER
        center2 = Point(300,60)
        bu = Text(center2, "WRONG ANSWER !! BUUU!")
        bu.setTextColor('White')
        bu.setSize(30)
        bu.draw(win)
        #Restart Button
        SRect = Rectangle(Point(220,250),Point(400,300))
        SRect.draw(win)
        SRect.setOutline('White')
        centerstart = Point(310,275)
        stxt = Text(centerstart, "RESTART")
        stxt.setSize(18)
        stxt.setStyle('bold')
        stxt.setTextColor('White')
        stxt.draw(win)
        #Wait for Mouse Click to Restart Game
        win.getMouse()
        bu.undraw()
        SRect.undraw()
        stxt.undraw()
        main()
                   
    #Third Possible Asnwer
    elif p.getX() >= 104 and p.getX() <= 245 and p.getY() >= 302 and p.getY() <= 344:
        label.undraw()
        a1.undraw()
        a2.undraw()
        a3.undraw()
        a4.undraw()
        label1.undraw()
        label2.undraw()
        label3.undraw()
        label4.undraw()

        # CORRECT ANSWER
        center = Point(300,200)
        congrats = Text(center, "CORRECT!!!")
        congrats.setTextColor('White')
        congrats.setSize(30)
        congrats.draw(win)

        #Next Question Button
        SRect = Rectangle(Point(220,250),Point(400,300))
        SRect.draw(win)
        SRect.setOutline('White')
        centerstart = Point(310,275)
        stxt = Text(centerstart, "Next Question >>")
        stxt.setSize(12)
        stxt.setStyle('bold')
        stxt.setTextColor('White')
        stxt.draw(win)
        #Wait for Mouse Click to go to next Question
        win.getMouse()
        congrats.undraw()
        SRect.undraw()
        stxt.undraw()
        q7()
        
    #Fourth Possible Answer
    elif p.getX() >= 353 and p.getX() <= 494 and p.getY() >= 303 and p.getY() <= 346:
        label.undraw()
        a1.undraw()
        a2.undraw()
        a3.undraw()
        a4.undraw()
        label1.undraw()
        label2.undraw()
        label3.undraw()
        label4.undraw()

        #WRONG ANSWER
        center2 = Point(300,60)
        bu = Text(center2, "WRONG ANSWER !! BUUU!")
        bu.setTextColor('White')
        bu.setSize(30)
        bu.draw(win)
        #Restart Button
        SRect = Rectangle(Point(220,250),Point(400,300))
        SRect.draw(win)
        SRect.setOutline('White')
        centerstart = Point(310,275)
        stxt = Text(centerstart, "RESTART")
        stxt.setSize(18)
        stxt.setStyle('bold')
        stxt.setTextColor('White')
        stxt.draw(win)
        #Wait for Mouse Click to Restart Game
        win.getMouse()
        bu.undraw()
        SRect.undraw()
        stxt.undraw()
        main()
def q7():
    
    centertxt = Point(300,100)
    label = Text(centertxt, "Which of these is not one of the official languages of the United Nations?")
    label.setTextColor('White')
    label.draw(win)
    
    # Button 1
    a1center = Point(175,225)
    a1 = Rectangle(Point(100, 200),Point(250, 250))
    a1.setOutline('White')
    a1.draw(win)
    # Button 2
    a2center = Point(427,224)
    a2 = Rectangle(Point(350,200), Point(500,250))
    a2.setOutline('White')
    a2.draw(win)
    # Button 3
    a3center = Point(174,326)
    a3 = Rectangle(Point(350,300), Point(500,350))
    a3.setOutline('White')
    a3.draw(win)
    # Button 4
    a4center = Point(425,325)
    a4 = Rectangle(Point(100,300), Point(250,350))
    a4.setOutline('White')
    a4.draw(win)

    #Answer 1
    label1 = Text(a1center, "Japanese")
    label1.setTextColor('White')
    label1.draw(win)
    #Answer 2
    label2 = Text(a2center, "English")
    label2.setTextColor('White')
    label2.draw(win)
    #Answer 3
    label3 = Text(a3center, "French")
    label3.setTextColor('White')
    label3.draw(win)
    #Answer 4
    label4 = Text(a4center, "Spanish")
    label4.setTextColor('White')
    label4.draw(win)

    p = win.getMouse()
    #First Possible Answer
    if p.getX() >= 103 and p.getX() <= 246 and p.getY() >= 202 and p.getY() <= 246:
        label.undraw()
        a1.undraw()
        a2.undraw()
        a3.undraw()
        a4.undraw()
        label1.undraw()
        label2.undraw()
        label3.undraw()
        label4.undraw()
        
        # CORRECT ANSWER
        center = Point(300,200)
        congrats = Text(center, "CORRECT!!!")
        congrats.setTextColor('White')
        congrats.setSize(30)
        congrats.draw(win)

        #Next Question Button
        SRect = Rectangle(Point(220,250),Point(400,300))
        SRect.draw(win)
        SRect.setOutline('White')
        centerstart = Point(310,275)
        stxt = Text(centerstart, "Next Question >>")
        stxt.setSize(12)
        stxt.setStyle('bold')
        stxt.setTextColor('White')
        stxt.draw(win)
        #Wait for Mouse Click to go to next Question
        win.getMouse()
        congrats.undraw()
        SRect.undraw()
        stxt.undraw()
        q8()
        

        
    #Second Possible Answer
    elif p.getX() >= 353 and p.getX() <= 496 and p.getY() >= 201 and p.getY() <= 245:
        label.undraw()
        a1.undraw()
        a2.undraw()
        a3.undraw()
        a4.undraw()
        label1.undraw()
        label2.undraw()
        label3.undraw()
        label4.undraw()

        #WRONG ANSWER
        center2 = Point(300,60)
        bu = Text(center2, "WRONG ANSWER !! BUUU!")
        bu.setTextColor('White')
        bu.setSize(30)
        bu.draw(win)
        #Restart Button
        SRect = Rectangle(Point(220,250),Point(400,300))
        SRect.draw(win)
        SRect.setOutline('White')
        centerstart = Point(310,275)
        stxt = Text(centerstart, "RESTART")
        stxt.setSize(18)
        stxt.setStyle('bold')
        stxt.setTextColor('White')
        stxt.draw(win)
        #Wait for Mouse Click to Restart Game
        win.getMouse()
        bu.undraw()
        SRect.undraw()
        stxt.undraw()
        main()
                   
    #Third Possible Asnwer
    elif p.getX() >= 104 and p.getX() <= 245 and p.getY() >= 302 and p.getY() <= 344:
        label.undraw()
        a1.undraw()
        a2.undraw()
        a3.undraw()
        a4.undraw()
        label1.undraw()
        label2.undraw()
        label3.undraw()
        label4.undraw()
        #WRONG ANSWER
        center2 = Point(300,60)
        bu = Text(center2, "WRONG ANSWER !! BUUU!")
        bu.setTextColor('White')
        bu.setSize(30)
        bu.draw(win)
        #Restart Button
        SRect = Rectangle(Point(220,250),Point(400,300))
        SRect.draw(win)
        SRect.setOutline('White')
        centerstart = Point(310,275)
        stxt = Text(centerstart, "RESTART")
        stxt.setSize(18)
        stxt.setStyle('bold')
        stxt.setTextColor('White')
        stxt.draw(win)
        #Wait for Mouse Click to Restart Game
        win.getMouse()
        bu.undraw()
        SRect.undraw()
        stxt.undraw()
        main()
    #Fourth Possible Answer
    elif p.getX() >= 353 and p.getX() <= 494 and p.getY() >= 303 and p.getY() <= 346:
        label.undraw()
        a1.undraw()
        a2.undraw()
        a3.undraw()
        a4.undraw()
        label1.undraw()
        label2.undraw()
        label3.undraw()
        label4.undraw()

        #WRONG ANSWER
        center2 = Point(300,60)
        bu = Text(center2, "WRONG ANSWER !! BUUU!")
        bu.setTextColor('White')
        bu.setSize(30)
        bu.draw(win)
        #Restart Button
        SRect = Rectangle(Point(220,250),Point(400,300))
        SRect.draw(win)
        SRect.setOutline('White')
        centerstart = Point(310,275)
        stxt = Text(centerstart, "RESTART")
        stxt.setSize(18)
        stxt.setStyle('bold')
        stxt.setTextColor('White')
        stxt.draw(win)
        #Wait for Mouse Click to Restart Game
        win.getMouse()
        bu.undraw()
        SRect.undraw()
        stxt.undraw()
        main()
def q8():
    
    centertxt = Point(300,100)
    label = Text(centertxt, "Which of these countries was not a member of the Axix alliance during WorldWar II?")
    label.setTextColor('White')
    label.draw(win)
    
    # Button 1
    a1center = Point(175,225)
    a1 = Rectangle(Point(100, 200),Point(250, 250))
    a1.setOutline('White')
    a1.draw(win)
    # Button 2
    a2center = Point(427,224)
    a2 = Rectangle(Point(350,200), Point(500,250))
    a2.setOutline('White')
    a2.draw(win)
    # Button 3
    a3center = Point(174,326)
    a3 = Rectangle(Point(350,300), Point(500,350))
    a3.setOutline('White')
    a3.draw(win)
    # Button 4
    a4center = Point(425,325)
    a4 = Rectangle(Point(100,300), Point(250,350))
    a4.setOutline('White')
    a4.draw(win)

    #Answer 1
    label1 = Text(a1center, "USA")
    label1.setTextColor('White')
    label1.draw(win)
    #Answer 2
    label2 = Text(a2center, "England")
    label2.setTextColor('White')
    label2.draw(win)
    #Answer 3
    label3 = Text(a3center, "France")
    label3.setTextColor('White')
    label3.draw(win)
    #Answer 4
    label4 = Text(a4center, "Spain")
    label4.setTextColor('White')
    label4.draw(win)

    p = win.getMouse()
    #First Possible Answer
    if p.getX() >= 103 and p.getX() <= 246 and p.getY() >= 202 and p.getY() <= 246:
        label.undraw()
        a1.undraw()
        a2.undraw()
        a3.undraw()
        a4.undraw()
        label1.undraw()
        label2.undraw()
        label3.undraw()
        label4.undraw()

        #WRONG ANSWER
        center2 = Point(300,60)
        bu = Text(center2, "WRONG ANSWER !! BUUU!")
        bu.setTextColor('White')
        bu.setSize(30)
        bu.draw(win)
        #Restart Button
        SRect = Rectangle(Point(220,250),Point(400,300))
        SRect.draw(win)
        SRect.setOutline('White')
        centerstart = Point(310,275)
        stxt = Text(centerstart, "RESTART")
        stxt.setSize(18)
        stxt.setStyle('bold')
        stxt.setTextColor('White')
        stxt.draw(win)
        #Wait for Mouse Click to Restart Game
        win.getMouse()
        bu.undraw()
        SRect.undraw()
        stxt.undraw()
        main()
        
    #Second Possible Answer
    elif p.getX() >= 353 and p.getX() <= 496 and p.getY() >= 201 and p.getY() <= 245:
        label.undraw()
        a1.undraw()
        a2.undraw()
        a3.undraw()
        a4.undraw()
        label1.undraw()
        label2.undraw()
        label3.undraw()
        label4.undraw()

        #WRONG ANSWER
        center2 = Point(300,60)
        bu = Text(center2, "WRONG ANSWER !! BUUU!")
        bu.setTextColor('White')
        bu.setSize(30)
        bu.draw(win)
        #Restart Button
        SRect = Rectangle(Point(220,250),Point(400,300))
        SRect.draw(win)
        SRect.setOutline('White')
        centerstart = Point(310,275)
        stxt = Text(centerstart, "RESTART")
        stxt.setSize(18)
        stxt.setStyle('bold')
        stxt.setTextColor('White')
        stxt.draw(win)
        #Wait for Mouse Click to Restart Game
        win.getMouse()
        bu.undraw()
        SRect.undraw()
        stxt.undraw()
        main()
                   
    #Third Possible Asnwer
    elif p.getX() >= 104 and p.getX() <= 245 and p.getY() >= 302 and p.getY() <= 344:
        label.undraw()
        a1.undraw()
        a2.undraw()
        a3.undraw()
        a4.undraw()
        label1.undraw()
        label2.undraw()
        label3.undraw()
        label4.undraw()
        #WRONG ANSWER
        center2 = Point(300,60)
        bu = Text(center2, "WRONG ANSWER !! BUUU!")
        bu.setTextColor('White')
        bu.setSize(30)
        bu.draw(win)
        #Restart Button
        SRect = Rectangle(Point(220,250),Point(400,300))
        SRect.draw(win)
        SRect.setOutline('White')
        centerstart = Point(310,275)
        stxt = Text(centerstart, "RESTART")
        stxt.setSize(18)
        stxt.setStyle('bold')
        stxt.setTextColor('White')
        stxt.draw(win)
        #Wait for Mouse Click to Restart Game
        win.getMouse()
        bu.undraw()
        SRect.undraw()
        stxt.undraw()
        main()
    #Fourth Possible Answer
    elif p.getX() >= 353 and p.getX() <= 494 and p.getY() >= 303 and p.getY() <= 346:
        label.undraw()
        a1.undraw()
        a2.undraw()
        a3.undraw()
        a4.undraw()
        label1.undraw()
        label2.undraw()
        label3.undraw()
        label4.undraw()
         # CORRECT ANSWER
        center = Point(300,200)
        congrats = Text(center, "CORRECT!!!")
        congrats.setTextColor('White')
        congrats.setSize(30)
        congrats.draw(win)

        #Next Question Button
        SRect = Rectangle(Point(220,250),Point(400,300))
        SRect.draw(win)
        SRect.setOutline('White')
        centerstart = Point(310,275)
        stxt = Text(centerstart, "Next Question >>")
        stxt.setSize(12)
        stxt.setStyle('bold')
        stxt.setTextColor('White')
        stxt.draw(win)
        #Wait for Mouse Click to go to next Question
        win.getMouse()
        congrats.undraw()
        SRect.undraw()
        stxt.undraw()
        q9()

def q8():
    
    centertxt = Point(300,100)
    label = Text(centertxt, "Which of these food is poisonous to dogs?")
    label.setTextColor('White')
    label.draw(win)
    
    # Button 1
    a1center = Point(175,225)
    a1 = Rectangle(Point(100, 200),Point(250, 250))
    a1.setOutline('White')
    a1.draw(win)
    # Button 2
    a2center = Point(427,224)
    a2 = Rectangle(Point(350,200), Point(500,250))
    a2.setOutline('White')
    a2.draw(win)
    # Button 3
    a3center = Point(174,326)
    a3 = Rectangle(Point(350,300), Point(500,350))
    a3.setOutline('White')
    a3.draw(win)
    # Button 4
    a4center = Point(425,325)
    a4 = Rectangle(Point(100,300), Point(250,350))
    a4.setOutline('White')
    a4.draw(win)

    #Answer 1
    label1 = Text(a1center, "Pork")
    label1.setTextColor('White')
    label1.draw(win)
    #Answer 2
    label2 = Text(a2center, "Chocolate")
    label2.setTextColor('White')
    label2.draw(win)
    #Answer 3
    label3 = Text(a3center, "Egg Yolks")
    label3.setTextColor('White')
    label3.draw(win)
    #Answer 4
    label4 = Text(a4center, "Pepper")
    label4.setTextColor('White')
    label4.draw(win)

    p = win.getMouse()
    #First Possible Answer
    if p.getX() >= 103 and p.getX() <= 246 and p.getY() >= 202 and p.getY() <= 246:
        label.undraw()
        a1.undraw()
        a2.undraw()
        a3.undraw()
        a4.undraw()
        label1.undraw()
        label2.undraw()
        label3.undraw()
        label4.undraw()
        #WRONG ANSWER
        center2 = Point(300,60)
        bu = Text(center2, "WRONG ANSWER !! BUUU!")
        bu.setTextColor('White')
        bu.setSize(30)
        bu.draw(win)
        #Restart Button
        SRect = Rectangle(Point(220,250),Point(400,300))
        SRect.draw(win)
        SRect.setOutline('White')
        centerstart = Point(310,275)
        stxt = Text(centerstart, "RESTART")
        stxt.setSize(18)
        stxt.setStyle('bold')
        stxt.setTextColor('White')
        stxt.draw(win)
        #Wait for Mouse Click to Restart Game
        win.getMouse()
        bu.undraw()
        SRect.undraw()
        stxt.undraw()
        main()
        
        
      
    #Second Possible Answer
    elif p.getX() >= 353 and p.getX() <= 496 and p.getY() >= 201 and p.getY() <= 245:
        label.undraw()
        a1.undraw()
        a2.undraw()
        a3.undraw()
        a4.undraw()
        label1.undraw()
        label2.undraw()
        label3.undraw()
        label4.undraw()
        # CORRECT ANSWER
        center = Point(300,200)
        congrats = Text(center, "CORRECT!!!")
        congrats.setTextColor('White')
        congrats.setSize(30)
        congrats.draw(win)

        #Next Question Button
        SRect = Rectangle(Point(220,250),Point(400,300))
        SRect.draw(win)
        SRect.setOutline('White')
        centerstart = Point(310,275)
        stxt = Text(centerstart, "Next Question >>")
        stxt.setSize(12)
        stxt.setStyle('bold')
        stxt.setTextColor('White')
        stxt.draw(win)
        #Wait for Mouse Click to go to next Question
        win.getMouse()
        congrats.undraw()
        SRect.undraw()
        stxt.undraw()
        q9()
        
        
                   
    #Third Possible Asnwer
    elif p.getX() >= 104 and p.getX() <= 245 and p.getY() >= 302 and p.getY() <= 344:
        label.undraw()
        a1.undraw()
        a2.undraw()
        a3.undraw()
        a4.undraw()
        label1.undraw()
        label2.undraw()
        label3.undraw()
        label4.undraw()
        #WRONG ANSWER
        center2 = Point(300,60)
        bu = Text(center2, "WRONG ANSWER !! BUUU!")
        bu.setTextColor('White')
        bu.setSize(30)
        bu.draw(win)
        #Restart Button
        SRect = Rectangle(Point(220,250),Point(400,300))
        SRect.draw(win)
        SRect.setOutline('White')
        centerstart = Point(310,275)
        stxt = Text(centerstart, "RESTART")
        stxt.setSize(18)
        stxt.setStyle('bold')
        stxt.setTextColor('White')
        stxt.draw(win)
        #Wait for Mouse Click to Restart Game
        win.getMouse()
        bu.undraw()
        SRect.undraw()
        stxt.undraw()
        main()
    #Fourth Possible Answer
    elif p.getX() >= 353 and p.getX() <= 494 and p.getY() >= 303 and p.getY() <= 346:
        label.undraw()
        a1.undraw()
        a2.undraw()
        a3.undraw()
        a4.undraw()
        label1.undraw()
        label2.undraw()
        label3.undraw()
        label4.undraw()

        #WRONG ANSWER
        center2 = Point(300,60)
        bu = Text(center2, "WRONG ANSWER !! BUUU!")
        bu.setTextColor('White')
        bu.setSize(30)
        bu.draw(win)
        #Restart Button
        SRect = Rectangle(Point(220,250),Point(400,300))
        SRect.draw(win)
        SRect.setOutline('White')
        centerstart = Point(310,275)
        stxt = Text(centerstart, "RESTART")
        stxt.setSize(18)
        stxt.setStyle('bold')
        stxt.setTextColor('White')
        stxt.draw(win)
        #Wait for Mouse Click to Restart Game
        win.getMouse()
        bu.undraw()
        SRect.undraw()
        stxt.undraw()
        main()

def q9():
    
    centertxt = Point(300,100)
    label = Text(centertxt, "Which of these is not found in a Snickers candy bar?")
    label.setTextColor('White')
    label.draw(win)
    
    # Button 1
    a1center = Point(175,225)
    a1 = Rectangle(Point(100, 200),Point(250, 250))
    a1.setOutline('White')
    a1.draw(win)
    # Button 2
    a2center = Point(427,224)
    a2 = Rectangle(Point(350,200), Point(500,250))
    a2.setOutline('White')
    a2.draw(win)
    # Button 3
    a3center = Point(174,326)
    a3 = Rectangle(Point(350,300), Point(500,350))
    a3.setOutline('White')
    a3.draw(win)
    # Button 4
    a4center = Point(425,325)
    a4 = Rectangle(Point(100,300), Point(250,350))
    a4.setOutline('White')
    a4.draw(win)

    #Answer 1
    label1 = Text(a1center, "Chocolate")
    label1.setTextColor('White')
    label1.draw(win)
    #Answer 2
    label2 = Text(a2center, "Sugar")
    label2.setTextColor('White')
    label2.draw(win)
    #Answer 3
    label3 = Text(a3center, "Milk")
    label3.setTextColor('White')
    label3.draw(win)
    #Answer 4
    label4 = Text(a4center, "Almonds")
    label4.setTextColor('White')
    label4.draw(win)

    p = win.getMouse()
    #First Possible Answer
    if p.getX() >= 103 and p.getX() <= 246 and p.getY() >= 202 and p.getY() <= 246:
        label.undraw()
        a1.undraw()
        a2.undraw()
        a3.undraw()
        a4.undraw()
        label1.undraw()
        label2.undraw()
        label3.undraw()
        label4.undraw()

        #WRONG ANSWER
        center2 = Point(300,60)
        bu = Text(center2, "WRONG ANSWER !! BUUU!")
        bu.setTextColor('White')
        bu.setSize(30)
        bu.draw(win)
        #Restart Button
        SRect = Rectangle(Point(220,250),Point(400,300))
        SRect.draw(win)
        SRect.setOutline('White')
        centerstart = Point(310,275)
        stxt = Text(centerstart, "RESTART")
        stxt.setSize(18)
        stxt.setStyle('bold')
        stxt.setTextColor('White')
        stxt.draw(win)
        #Wait for Mouse Click to Restart Game
        win.getMouse()
        bu.undraw()
        SRect.undraw()
        stxt.undraw()
        main()
        
    #Second Possible Answer
    elif p.getX() >= 353 and p.getX() <= 496 and p.getY() >= 201 and p.getY() <= 245:
        label.undraw()
        a1.undraw()
        a2.undraw()
        a3.undraw()
        a4.undraw()
        label1.undraw()
        label2.undraw()
        label3.undraw()
        label4.undraw()

        #WRONG ANSWER
        center2 = Point(300,60)
        bu = Text(center2, "WRONG ANSWER !! BUUU!")
        bu.setTextColor('White')
        bu.setSize(30)
        bu.draw(win)
        #Restart Button
        SRect = Rectangle(Point(220,250),Point(400,300))
        SRect.draw(win)
        SRect.setOutline('White')
        centerstart = Point(310,275)
        stxt = Text(centerstart, "RESTART")
        stxt.setSize(18)
        stxt.setStyle('bold')
        stxt.setTextColor('White')
        stxt.draw(win)
        #Wait for Mouse Click to Restart Game
        win.getMouse()
        bu.undraw()
        SRect.undraw()
        stxt.undraw()
        main()
                   
    #Third Possible Asnwer
    elif p.getX() >= 104 and p.getX() <= 245 and p.getY() >= 302 and p.getY() <= 344:
        label.undraw()
        a1.undraw()
        a2.undraw()
        a3.undraw()
        a4.undraw()
        label1.undraw()
        label2.undraw()
        label3.undraw()
        label4.undraw()
        #WRONG ANSWER
        center2 = Point(300,60)
        bu = Text(center2, "WRONG ANSWER !! BUUU!")
        bu.setTextColor('White')
        bu.setSize(30)
        bu.draw(win)
        #Restart Button
        SRect = Rectangle(Point(220,250),Point(400,300))
        SRect.draw(win)
        SRect.setOutline('White')
        centerstart = Point(310,275)
        stxt = Text(centerstart, "RESTART")
        stxt.setSize(18)
        stxt.setStyle('bold')
        stxt.setTextColor('White')
        stxt.draw(win)
        #Wait for Mouse Click to Restart Game
        win.getMouse()
        bu.undraw()
        SRect.undraw()
        stxt.undraw()
        main()
    #Fourth Possible Answer
    elif p.getX() >= 353 and p.getX() <= 494 and p.getY() >= 303 and p.getY() <= 346:
        label.undraw()
        a1.undraw()
        a2.undraw()
        a3.undraw()
        a4.undraw()
        label1.undraw()
        label2.undraw()
        label3.undraw()
        label4.undraw()
         # CORRECT ANSWER
        center = Point(300,200)
        congrats = Text(center, "CORRECT!!!")
        congrats.setTextColor('White')
        congrats.setSize(30)
        congrats.draw(win)

        #Next Question Button
        SRect = Rectangle(Point(220,250),Point(400,300))
        SRect.draw(win)
        SRect.setOutline('White')
        centerstart = Point(310,275)
        stxt = Text(centerstart, "Next Question >>")
        stxt.setSize(12)
        stxt.setStyle('bold')
        stxt.setTextColor('White')
        stxt.draw(win)
        #Wait for Mouse Click to go to next Question
        win.getMouse()
        congrats.undraw()
        SRect.undraw()
        stxt.undraw()
        q10()

def q10():
    
    centertxt = Point(300,100)
    label = Text(centertxt, "If you ask for ''gai'' at a Thai restaurant, what will you get?")
    label.setTextColor('White')
    label.draw(win)
    
    # Button 1
    a1center = Point(175,225)
    a1 = Rectangle(Point(100, 200),Point(250, 250))
    a1.setOutline('White')
    a1.draw(win)
    # Button 2
    a2center = Point(427,224)
    a2 = Rectangle(Point(350,200), Point(500,250))
    a2.setOutline('White')
    a2.draw(win)
    # Button 3
    a3center = Point(174,326)
    a3 = Rectangle(Point(350,300), Point(500,350))
    a3.setOutline('White')
    a3.draw(win)
    # Button 4
    a4center = Point(425,325)
    a4 = Rectangle(Point(100,300), Point(250,350))
    a4.setOutline('White')
    a4.draw(win)

    #Answer 1
    label1 = Text(a1center, "Chicken")
    label1.setTextColor('White')
    label1.draw(win)
    #Answer 2
    label2 = Text(a2center, "Salt")
    label2.setTextColor('White')
    label2.draw(win)
    #Answer 3
    label3 = Text(a3center, "Beef")
    label3.setTextColor('White')
    label3.draw(win)
    #Answer 4
    label4 = Text(a4center, "Green Peas")
    label4.setTextColor('White')
    label4.draw(win)

    p = win.getMouse()
    #First Possible Answer
    if p.getX() >= 103 and p.getX() <= 246 and p.getY() >= 202 and p.getY() <= 246:
        label.undraw()
        a1.undraw()
        a2.undraw()
        a3.undraw()
        a4.undraw()
        label1.undraw()
        label2.undraw()
        label3.undraw()
        label4.undraw()
        
        # CORRECT ANSWER
        center = Point(300,200)
        congrats = Text(center, "CORRECT!!!")
        congrats.setTextColor('White')
        congrats.setSize(30)
        congrats.draw(win)

        #Next Question Button
        SRect = Rectangle(Point(220,250),Point(400,300))
        SRect.draw(win)
        SRect.setOutline('White')
        centerstart = Point(310,275)
        stxt = Text(centerstart, "Next Question >>")
        stxt.setSize(12)
        stxt.setStyle('bold')
        stxt.setTextColor('White')
        stxt.draw(win)
        #Wait for Mouse Click to go to next Question
        win.getMouse()
        congrats.undraw()
        SRect.undraw()
        stxt.undraw()
        q11()
        

        
    #Second Possible Answer
    elif p.getX() >= 353 and p.getX() <= 496 and p.getY() >= 201 and p.getY() <= 245:
        label.undraw()
        a1.undraw()
        a2.undraw()
        a3.undraw()
        a4.undraw()
        label1.undraw()
        label2.undraw()
        label3.undraw()
        label4.undraw()

        #WRONG ANSWER
        center2 = Point(300,60)
        bu = Text(center2, "WRONG ANSWER !! BUUU!")
        bu.setTextColor('White')
        bu.setSize(30)
        bu.draw(win)
        #Restart Button
        SRect = Rectangle(Point(220,250),Point(400,300))
        SRect.draw(win)
        SRect.setOutline('White')
        centerstart = Point(310,275)
        stxt = Text(centerstart, "RESTART")
        stxt.setSize(18)
        stxt.setStyle('bold')
        stxt.setTextColor('White')
        stxt.draw(win)
        #Wait for Mouse Click to Restart Game
        win.getMouse()
        bu.undraw()
        SRect.undraw()
        stxt.undraw()
        main()
                   
    #Third Possible Asnwer
    elif p.getX() >= 104 and p.getX() <= 245 and p.getY() >= 302 and p.getY() <= 344:
        label.undraw()
        a1.undraw()
        a2.undraw()
        a3.undraw()
        a4.undraw()
        label1.undraw()
        label2.undraw()
        label3.undraw()
        label4.undraw()
        #WRONG ANSWER
        center2 = Point(300,60)
        bu = Text(center2, "WRONG ANSWER !! BUUU!")
        bu.setTextColor('White')
        bu.setSize(30)
        bu.draw(win)
        #Restart Button
        SRect = Rectangle(Point(220,250),Point(400,300))
        SRect.draw(win)
        SRect.setOutline('White')
        centerstart = Point(310,275)
        stxt = Text(centerstart, "RESTART")
        stxt.setSize(18)
        stxt.setStyle('bold')
        stxt.setTextColor('White')
        stxt.draw(win)
        #Wait for Mouse Click to Restart Game
        win.getMouse()
        bu.undraw()
        SRect.undraw()
        stxt.undraw()
        main()
    #Fourth Possible Answer
    elif p.getX() >= 353 and p.getX() <= 494 and p.getY() >= 303 and p.getY() <= 346:
        label.undraw()
        a1.undraw()
        a2.undraw()
        a3.undraw()
        a4.undraw()
        label1.undraw()
        label2.undraw()
        label3.undraw()
        label4.undraw()

        #WRONG ANSWER
        center2 = Point(300,60)
        bu = Text(center2, "WRONG ANSWER !! BUUU!")
        bu.setTextColor('White')
        bu.setSize(30)
        bu.draw(win)
        #Restart Button
        SRect = Rectangle(Point(220,250),Point(400,300))
        SRect.draw(win)
        SRect.setOutline('White')
        centerstart = Point(310,275)
        stxt = Text(centerstart, "RESTART")
        stxt.setSize(18)
        stxt.setStyle('bold')
        stxt.setTextColor('White')
        stxt.draw(win)
        #Wait for Mouse Click to Restart Game
        win.getMouse()
        bu.undraw()
        SRect.undraw()
        stxt.undraw()
        main()

def q11():
    
    centertxt = Point(300,100)
    label = Text(centertxt, "Which of these horror films spawned the most sequels?")
    label.setTextColor('White')
    label.draw(win)
    
    # Button 1
    a1center = Point(175,225)
    a1 = Rectangle(Point(100, 200),Point(250, 250))
    a1.setOutline('White')
    a1.draw(win)
    # Button 2
    a2center = Point(427,224)
    a2 = Rectangle(Point(350,200), Point(500,250))
    a2.setOutline('White')
    a2.draw(win)
    # Button 3
    a3center = Point(174,326)
    a3 = Rectangle(Point(350,300), Point(500,350))
    a3.setOutline('White')
    a3.draw(win)
    # Button 4
    a4center = Point(425,325)
    a4 = Rectangle(Point(100,300), Point(250,350))
    a4.setOutline('White')
    a4.draw(win)

    #Answer 1
    label1 = Text(a1center, "Saw")
    label1.setTextColor('White')
    label1.draw(win)
    #Answer 2
    label2 = Text(a2center, "Friday the 13th")
    label2.setTextColor('White')
    label2.draw(win)
    #Answer 3
    label3 = Text(a3center, "Texas Massacre")
    label3.setTextColor('White')
    label3.draw(win)
    #Answer 4
    label4 = Text(a4center, "Freddy Vs Jason")
    label4.setTextColor('White')
    label4.draw(win)

    p = win.getMouse()
    #First Possible Answer
    if p.getX() >= 103 and p.getX() <= 246 and p.getY() >= 202 and p.getY() <= 246:
        label.undraw()
        a1.undraw()
        a2.undraw()
        a3.undraw()
        a4.undraw()
        label1.undraw()
        label2.undraw()
        label3.undraw()
        label4.undraw()
        #WRONG ANSWER
        center2 = Point(300,60)
        bu = Text(center2, "WRONG ANSWER !! BUUU!")
        bu.setTextColor('White')
        bu.setSize(30)
        bu.draw(win)
        #Restart Button
        SRect = Rectangle(Point(220,250),Point(400,300))
        SRect.draw(win)
        SRect.setOutline('White')
        centerstart = Point(310,275)
        stxt = Text(centerstart, "RESTART")
        stxt.setSize(18)
        stxt.setStyle('bold')
        stxt.setTextColor('White')
        stxt.draw(win)
        #Wait for Mouse Click to Restart Game
        win.getMouse()
        bu.undraw()
        SRect.undraw()
        stxt.undraw()
        main()
        
        
      
    #Second Possible Answer
    elif p.getX() >= 353 and p.getX() <= 496 and p.getY() >= 201 and p.getY() <= 245:
        label.undraw()
        a1.undraw()
        a2.undraw()
        a3.undraw()
        a4.undraw()
        label1.undraw()
        label2.undraw()
        label3.undraw()
        label4.undraw()
        # CORRECT ANSWER
        center = Point(300,200)
        congrats = Text(center, "CORRECT!!!")
        congrats.setTextColor('White')
        congrats.setSize(30)
        congrats.draw(win)

        #Next Question Button
        SRect = Rectangle(Point(220,250),Point(400,300))
        SRect.draw(win)
        SRect.setOutline('White')
        centerstart = Point(310,275)
        stxt = Text(centerstart, "Next Question >>")
        stxt.setSize(12)
        stxt.setStyle('bold')
        stxt.setTextColor('White')
        stxt.draw(win)
        #Wait for Mouse Click to go to next Question
        win.getMouse()
        congrats.undraw()
        SRect.undraw()
        stxt.undraw()
        q12()
        
        
                   
    #Third Possible Asnwer
    elif p.getX() >= 104 and p.getX() <= 245 and p.getY() >= 302 and p.getY() <= 344:
        label.undraw()
        a1.undraw()
        a2.undraw()
        a3.undraw()
        a4.undraw()
        label1.undraw()
        label2.undraw()
        label3.undraw()
        label4.undraw()
        #WRONG ANSWER
        center2 = Point(300,60)
        bu = Text(center2, "WRONG ANSWER !! BUUU!")
        bu.setTextColor('White')
        bu.setSize(30)
        bu.draw(win)
        #Restart Button
        SRect = Rectangle(Point(220,250),Point(400,300))
        SRect.draw(win)
        SRect.setOutline('White')
        centerstart = Point(310,275)
        stxt = Text(centerstart, "RESTART")
        stxt.setSize(18)
        stxt.setStyle('bold')
        stxt.setTextColor('White')
        stxt.draw(win)
        #Wait for Mouse Click to Restart Game
        win.getMouse()
        bu.undraw()
        SRect.undraw()
        stxt.undraw()
        main()
    #Fourth Possible Answer
    elif p.getX() >= 353 and p.getX() <= 494 and p.getY() >= 303 and p.getY() <= 346:
        label.undraw()
        a1.undraw()
        a2.undraw()
        a3.undraw()
        a4.undraw()
        label1.undraw()
        label2.undraw()
        label3.undraw()
        label4.undraw()

        #WRONG ANSWER
        center2 = Point(300,60)
        bu = Text(center2, "WRONG ANSWER !! BUUU!")
        bu.setTextColor('White')
        bu.setSize(30)
        bu.draw(win)
        #Restart Button
        SRect = Rectangle(Point(220,250),Point(400,300))
        SRect.draw(win)
        SRect.setOutline('White')
        centerstart = Point(310,275)
        stxt = Text(centerstart, "RESTART")
        stxt.setSize(18)
        stxt.setStyle('bold')
        stxt.setTextColor('White')
        stxt.draw(win)
        #Wait for Mouse Click to Restart Game
        win.getMouse()
        bu.undraw()
        SRect.undraw()
        stxt.undraw()
        main()

def q12():
    
    centertxt = Point(300,100)
    label = Text(centertxt, "What is a balalaika?")
    label.setTextColor('White')
    label.draw(win)
    
    # Button 1
    a1center = Point(175,225)
    a1 = Rectangle(Point(100, 200),Point(250, 250))
    a1.setOutline('White')
    a1.draw(win)
    # Button 2
    a2center = Point(427,224)
    a2 = Rectangle(Point(350,200), Point(500,250))
    a2.setOutline('White')
    a2.draw(win)
    # Button 3
    a3center = Point(174,326)
    a3 = Rectangle(Point(350,300), Point(500,350))
    a3.setOutline('White')
    a3.draw(win)
    # Button 4
    a4center = Point(425,325)
    a4 = Rectangle(Point(100,300), Point(250,350))
    a4.setOutline('White')
    a4.draw(win)

    #Answer 1
    label1 = Text(a1center, "Fish")
    label1.setTextColor('White')
    label1.draw(win)
    #Answer 2
    label2 = Text(a2center, "Dance")
    label2.setTextColor('White')
    label2.draw(win)
    #Answer 3
    label3 = Text(a3center, "Brand")
    label3.setTextColor('White')
    label3.draw(win)
    #Answer 4
    label4 = Text(a4center, "Musical Instrument")
    label4.setTextColor('White')
    label4.draw(win)

    p = win.getMouse()
    #First Possible Answer
    if p.getX() >= 103 and p.getX() <= 246 and p.getY() >= 202 and p.getY() <= 246:
        label.undraw()
        a1.undraw()
        a2.undraw()
        a3.undraw()
        a4.undraw()
        label1.undraw()
        label2.undraw()
        label3.undraw()
        label4.undraw()

        #WRONG ANSWER
        center2 = Point(300,60)
        bu = Text(center2, "WRONG ANSWER !! BUUU!")
        bu.setTextColor('White')
        bu.setSize(30)
        bu.draw(win)
        #Restart Button
        SRect = Rectangle(Point(220,250),Point(400,300))
        SRect.draw(win)
        SRect.setOutline('White')
        centerstart = Point(310,275)
        stxt = Text(centerstart, "RESTART")
        stxt.setSize(18)

Recommended Answers

All 13 Replies

This program is 3000 lines long. It can easily be reduced to 500 lines by refactoring. I think this is the first step before you add new features.

commented: Well said. Good point for programming. +1

Gribouillis said it all.

There is no reason for repeating code when it can be reused.

Yeah refactor is the best thing since the invention of fire (that's an overstatement, but still).

Here is an example of why refactor is awesome:
The source engine used to only do single core CPUs, with a large code refactor, it supported multi core cPUs.

Example, just by refactoring this part, you can save a lot of lines

label.undraw()
        a1.undraw()
        a2.undraw()
        a3.undraw()
        a4.undraw()
        label1.undraw()
        label2.undraw()
        label3.undraw()
        label4.undraw()

TO

def undrawstuff():
    label.undraw()
    a1.undraw()
    a2.undraw()
    a3.undraw()
    a4.undraw()
    label1.undraw()
    label2.undraw()
    label3.undraw()
    label4.undraw()

Oh ok, thnx for that advice, any help on the bugs and score system?

I don't think anyone has patient to read through a 3000 line source, especially when it's uncommented and not refactored. Once you have refactored the code, it should allow you to add a scoring system and fix bugs much easier as you only need to change 1 function instead of 10 different locations.

I ran Clone Digger on your code (easy_install clonedigger, see here http://clonedigger.sourceforge.net/). It took a while to run but it found 3023 duplicates in your code, and it says that 97 % of your lines are duplicates. See the result in the attached file

I ran the same script. briefly looked at the result. I'm going to say that it's not entirely accurate, but at best 80% of your code are duplicates.

I ran clone digger through one of mine recently refactored source code and only found 1 clone, which doesn't even really apply, as it is a similar variable name.
I find that changing stuff on that app is incredibly easy. So seriously, REFACTOR! =D

oh well, is just that im not that advanced so thats why I have such a big code, but ill refactor that undrawstuff

if you want to get to a higher level, utilizing functions is very crutial. Utilizing classes is also very important. This makes refactor the most important thing ever.

As to your score system, here's something that can potentially help you (in pseudo code)

if self.answerIsCorrect(answer):
    self.redrawGUIForCorrectAnswer() # This should redraw the GUI for a correctAnswer. You should have this right now
    self.addToPlayerScore(score) # You should only need to add this function and this line.
    self.nextRound(currentRoundNumber+1) # You should also have this right now

well i just changed every undraw for a function that I made, but now when I press an answer, it gives me an error:

Traceback (most recent call last):
  File "C:\Users\student\Desktop\Who wants to be a Millionaire.py", line 2537, in <module>
    main()
  File "C:\Users\student\Desktop\Who wants to be a Millionaire.py", line 2532, in main
    q1()
  File "C:\Users\student\Desktop\Who wants to be a Millionaire.py", line 68, in q1
    undrawstuff()
  File "C:\Users\student\Desktop\Who wants to be a Millionaire.py", line 9, in undrawstuff
    label.undraw()
NameError: global name 'label' is not defined

oh yeah, one thing i forgot to mention, once you refactor code, you have to worry about global and local variables. That's why using class is more helpful in this situation

I really recommend you to learn more about Object oriented programmign and functions, variables, arguments etc in general before attempting to create these apps.

Think Python is a good starting place

Why don't you just use the button class that I gave you in another thread, it would make your life a lot easier if you learn classes. Your problem is that once a click occurs outside of one of the buttons there is no infinite loop to check for the next mouse click in the question loop. Then it goes back to your main where there is a invisible button.. The best way to set this up is first to simplify your code, this program can be written in under 300 lines.

commented: good point +4
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.