for k in range(3):
code = 'name{}=[]'.format(k)
exec(code)
for l in range(10):
eval('name{}'.format(k)).append(l)
print(name0)
print(name1)
print(name2)
print('###')
lstlst = [[] for k in range(3)]
for lst in lstlst:
for l in range(10):
lst.append(l)
for lst in lstlst:
print(lst)
ツイートシェア