Back
If I get you right, you want to swap the first element of the list A with the last element of list B, then the second element of list A with second last of list B, Then:
l = len(listA)for i in range(0, l): listA[i], listB[(l - 1) - i] = listB[(l - 1) - i], listA[i]
l = len(listA)
for i in range(0, l):
listA[i], listB[(l - 1) - i] = listB[(l - 1) - i], listA[i]
Improve your knowledge in data science from scratch using Data Scientist
31k questions
32.8k answers
501 comments
693 users