-4
def insert(listA, listB, index):
for item in listA:
listB.append(item)
print(listB)
>>> insert([1, 2, 3], ['a', 'b', 'c'], 2)
>>> ['a', 'b', 'c', 1, 2, 3]
如何使它输出:[1, 2, 'a', 'b', 'c', 3]
'listA [:index] + listB + listA [index:]' – inspectorG4dget