Answer the question
In order to leave comments, you need to log in
How to make it so that the program itself can create variables, lists, tuples, etc. in Python?
How to make it so that the program itself can create variables, lists, tuples, etc. in Python?
Answer the question
In order to leave comments, you need to log in
exec()
eval()
also look at the namedtuple class sources of the collections module
>>> exec('a = [1,2,3]')
>>> a
[1, 2, 3]
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question