我想一次追加多個元素到我的列表中。我想這Python列表追加多個元素
>>> l = []
>>> l.append('a')
>>> l
['a']
>>> l.append('b').append('c')
Traceback (most recent call last):
File "<pyshell#10>", line 1, in <module>
l.append('b').append('c')
AttributeError: 'NoneType' object has no attribute 'append'
>>>
我怎麼可以追加'b'
和'c'
一次?
'my_list + ['a','b']' –