两个列表拼接
alist1=["apple","banana","orange"] alist2=["pear","peach","watermelon"] alist1.append(alist2) print(alist1)
'''
['apple', 'banana', 'orange', ['pear', 'peach', 'watermelon']]
'''
-----------------------------------------------------------------------------
alist1=["apple","banana","orange"] alist2=["pear","peach","watermelon"] alist1.extend(alist2) print(alist1)
'''
['apple', 'banana', 'orange', 'pear', 'peach', 'watermelon']
'''
----------------------------------------------------------------------
alist1=["apple","banana","orange"] alist2=["pear","peach","watermelon"] a3=alist1+alist2 print(a3)
'''
['apple', 'banana', 'orange', 'pear', 'peach', 'watermelon']
'''