Answers for "python how to create attribute of class while iterating a list"

1

python how to create attribute of class while iterating a list

>>> class c(object):
...     for i in range(10):
...         locals()['A' + str(i)] = i
... 
>>> c.A0
0
>>> c.A7
7
Posted by: Guest on July-31-2020

Code answers related to "python how to create attribute of class while iterating a list"

Python Answers by Framework

Browse Popular Code Answers by Language