Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
为什么print [1].append(2)评估为无?我预计[1,2]
print [1].append(2)
[1,2]
>>> print [1].append(2) None
那是因为 append 什么都不返回 (= None)。
None
array.append不返回您附加到的数组,它返回None.
array.append