How can I turn a string into a call to a variable and retrieve the variable contents?

Question:

I’m trying to call a different variable based on the input the function receives, but I don’t know how to change the text based on the input. How can I turn a string into a call to a variable to make my text say "you chose" and based on the decision variable, a certain choice?

def blab(decision):
    Choice_0 = "Python Ideas"
    Choice_1 = "Website Ideas"
    Choice_2 = "Discord Ideas"
    Choice_3 = "Game Ideas"
    Choice_4 = "Robot Ideas"
    real_choice = Choice_ + decision

    deci = input(F"You chose {real_choice}")
Asked By: GOODTOAD

||

Answers:

Why not use a list?

def blab(decision):
    choices = [
        "Python Ideas"
        "Website Ideas"
        "Discord Ideas"
        "Game Ideas"
        "Robot Ideas"
    ]
    real_choice = choices[decision]

    deci = input(F"You chose {real_choice}")
Answered By: Rahul
Categories: questions Tags:
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.