Why does print [1].append(2)
evaluate to None? I expect [1,2]
>>> print [1].append(2)
None
That's because append returns nothing (= None
).
>>> print [1].append(2)
None
array.append
不返回您追加的数组,它返回None
。
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.