How to make a variable equate to another variable (Python)
Question: I don't even know how to explain this one.

    
    
    Question1 = "a" 
    Question2 = "b" 
    Question3 = "c" 
    Question4 = "d"
    Question5 = "e"
    

etc.

    
    
    Answer1 = "a" 
    Answer2 = "b" 
    Answer3 = "c" 
    Answer4 = "d" 
    Answer5 = "e"
    

etc.

    
    
    questioninteger = random.randint(1,20)
    if(questioninteger == 1):
        Boolean1 = True
        Question == Question1
        Answer == Answer1
        FlashCard()
    if(questioninteger == 2):
        Boolean2 = True
        Question == Question2
        Answer == Answer2
        FlashCard()
    if(questioninteger == 3):
        Boolean3 = True
        Question == Question3
        Answer == Answer3
        FlashCard()
    

etc.

    
    
    print("")
    print(Question)
    print("")
    key = raw_input()
    if(key == Answer):
        print("Correct!")
        time.sleep(1)
        QuestionPicker()
    

(all are within functions)

Problem is Python won't change the variable Question, and no error comes up.
'Answer is successfully changed, 'Question' just won't be.


Answer: Global variables are generally a bad idea; you would do well to rewrite your
code to something like

    
    
    from random import choice
    from time import sleep
    
    class Question:
        def __init__(self, question, options, answer):
            self.question = question
            self.options  = options
            self.answer   = answer
    
        def ask(self):
            print("\n" + self.question)
            for opt in self.options:
                print(opt)
            response = input().strip()
            return (response == self.answer)
    
    # define a list of questions
    questions = [
        Question("What is 10 * 2?",                 ["5", "10", "12", "20", "100"],            "20"),
        Question("Which continent has alligators?", ["Africa", "South America", "Antarctica"], "South America")
    ]
    
    # ask a randomly chosen question
    def ask_a_question(questions):
        q      = choice(questions)
        got_it = q.ask()
        sleep(1)
        if got_it:
            print("Correct!")
        else:
            print("Sorry, the proper answer is " + q.answer)
    

