In Python Shell, I entered:
aList = ['a', 'b', 'c', 'd']
for i in aList:
print(i)
and got
a
b
c
d
but when I tried:
aList = ['a', 'b', 'c', 'd']
aList = aList.append('e')
for i in aList:
print(i)
and got
Traceback (most recent call last):
File "<pyshell#22>", line 1, in <module>
for i in aList:
TypeError: 'NoneType' object is not iterable
Does anyone know what's going on? How can I fix/get around it?
Question&Answers:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…