#try to avoid input function a = [1,2,3,4,5,6] b = 0 for i in range(len(a)//2): a[b],a[b+1] = a[b+1],a[b] b = b+2 print(a)
Click the run button. Try to avoid input() function.