Example-
list is [1,2,3,4,5,6]
Aim to convert this list in [2,1,4,3,6,5]
program-
print("Enter number in list")
l=list(map(int,input().split()))
print("List is",l)
i=0
while(i<'len(l)):
l[i],l[i+1]=l[i+1],l[i]
i+=2
print("List become",l)
Enter number in list
1 2 3 4 5 6
List is [1, 2, 3, 4, 5, 6]
List become [2, 1, 4, 3, 6, 5]
Enter number in list
87 65 34 12 6 5
List is [87, 65, 34, 12, 6, 5]
List become [65, 87, 12, 34, 5, 6]