在python列表中,extend和append都可以往列表中加入元素,extend是扩充单个元素,如:
a = 'abc123' b = [] b.extend(a) >>>b = ['a', 'b', 'c', '1', '2', '3']
而append是扩充整个字符串,如:
a = 'abc123' b = [] b.extend(a) >>>b = ['abc123']
标签:extend,python,list,列表,abc123,append From: https://www.cnblogs.com/NevilleWang/p/16844737.html