在 Python Shell 中,我输入:
aList = ['a', 'b', 'c', 'd']
for i in aList:
print(i)
并得到
a
b
c
d
但是当我尝试时:
aList = ['a', 'b', 'c', 'd']
aList = aList.append('e')
for i in aList:
print(i)
并得到
Traceback (most recent call last):
File "<pyshell#22>", line 1, in <module>
for i in aList:
TypeError: 'NoneType' object is not iterable
有谁知道发生了什么?我该如何解决/解决它?