list1 = [1,2,3,'d','wsdftgyhuj']
list2 = [7,8,8,9]
list1.append(list2)
print(list1)
==>[1, 2, 3, 'd', 'wsdftgyhuj', [7, 8, 8, 9]]
list1 = [1,2,3,'d','wsdftgyhuj']
list2 = [7,8,8,9]
list1.extend(list2)
print(list1)
==>[1, 2, 3, 'd', 'wsdftgyhuj', 7, 8, 8, 9]
list1 = [1,2,3,7,9,'d','wsdftgyhuj']
list2 = [7,8,8,9]
print(list1+list2)
==>[1, 2, 3, 7, 9, 'd', 'wsdftgyhuj', 7, 8, 8, 9]
list1 = [1,2,3,7,9,'d','wsdftgyhuj']
list2 = [''] * 4
list1.extend(list2)
print(list1)
==>[1, 2, 3, 7, 9, 'd', 'wsdftgyhuj', '', '', '', '']
网友评论