a
=[0,1,2,3]
target
= 4
a
.append
((target
))
b
= a
.append
((target
))
print(a
)
print(b
)
输出结果为:
[0, 1, 2, 3, 4, 4]
None
是不是在赋值过程中要求格式必须相同呢? 但是如果执行下面的操作:
a
=[0,1,2,3]
target
= 4
a
.append
((target
))
print(a
)
c
= a
print(c
)
结果为:
[0, 1, 2, 3, 4]
[0, 1, 2, 3, 4]
这样赋值时完全可以的。
转载请注明原文地址:https://ipadbbs.8miu.com/read-52385.html