for循环添加至数组

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(

你可能感兴趣的:(for循环添加至数组)