[Python] Is there a way to make the names of variables a string and put them in a list?

Discussão em 'Python' iniciado por Stack, Julho 27, 2025.

  1. Stack

    Stack Membro Participativo

    I have the following:

    a = type(int)
    b = type(int)
    c = type(int)



    now, how can I get a list like the following without manually typing it in:

    list = ["a","b","c"]


    where 'a','b', and 'c' are the names of the variables. Not the numbers that the variables are equal to.

    to be honest, with my limited knowledge I couldn't think of any function that does this.

    Continue reading...

Compartilhe esta Página