Полагаю, вы можете захотеть сделать что-то подобное,
mem = int(input("Number of members: "))
members = [int(i) for i in input("List members: ").split()]
idx = int(input("Number of indexes: "))
indexes = [tuple(map(int, input("index: ").split())) for i in range(idx)]
for a, b in indexes:
members[a - 1], members[b - 1] = members[b - 1], members[a - 1]
print(members)
Ввод:
Number of members: 3
List members: 1 2 3
Number of indexes: 3
index: 2 3
index: 2 2
index: 2 3
Вывод:
[1, 3, 2]
[1, 3, 2]
[1, 2, 3]