def exchange(data):
n2 = len(data)
for i in range(0, n2, 2):
data[i], data[i+1] = data[i+1], data[i]
return data
def fun2(list2):
res = []
for i in range(0, len(list2)-1, 2):
res.append(list2[i+1])
res.append(list2[i])
return res
list2 = [1, 2, 3, 4, 5, 6]
list3 = [1, 2, 3, 4, 5, 6]
print(exchange(list2))
print(fun2(list3))