- def merge_and_swap(list1, list2):
-
list1=list1+list2
-
-
list1.insert(0,list[-1])
-
list1.pop(4)
-
-
list1.insert(1,list[4])
-
list1.pop(1)
-
-
return list1
-
-
print(merge_and_swap([1,2,3], [5]))
-
I took a Error line which is 'TypeError: 'type' object is not subscriptable. What's the matter on my code and how can I solve it? Please give me an answer.