for循环添加至数组
2022-01-12 本文已影响0人
Lee_M
import random
list_a = []
list = [[1,1,0,1,0], [1,0,1,1,1]]
def mutation(array):
array.append(random.randint(1,10))
return array
def test2():
for num in list:
for i in range(3):
a = mutation(num)
print(a)
print('a_id=',id(a))
list_a.append(a)
print(list_a)
test2(