Because it is not a computer related major , Therefore, it is impossible to use professional language to describe . Look at the code directly .
If you don't know this mistake , Then you can only debugger When I found out
# twopics
import random
ls1 = []
ls = [2,2]
for i in range(1,3):
ls[0] = random.randint(1,88)
ls[1] = random.randint(1,88)
ls1.append(ls)
print(ls1)
# output : [[55, 62], [55, 62]] , [[48, 16], [48, 16]] , [[41, 48], [41, 48]]
# Failure to create a new array resulted in an error
# solve
lss1 = []
lss = [2,2]
for i in range(1,3):
l = []
lss[0] = random.randint(1,88)
lss[1] = random.randint(1,88)
l = [lss[0],lss[1]]
lss1.append(l)
print(lss1)
# output : [[14, 81], [45, 56]] . [[25, 69], [17, 14]]
# however
a = 1
ll =[]
ll.append(a)
ll.append(a)
print(ll)
a = 2
print(ll)
# output
# [1, 1]
# [1, 1]
# however
a1 = [1]
ll1 =[]
ll1.append(a1)
ll1.append(a1)
print(ll1)
a1 = [2]
print(ll1)
# output
#[[1], [1]]
#[[1], [1]]