x=int(input("Enter x:"))
y=int(input("Enter y:"))
# Method 1
x,y=y,x
print(x,y)
# Method 2
t=x
x=y
y=t
print(x,y)
# Method 3
x=x+y
y=x-y
x=x-y
print(x,y)
# Method 4
x=x^y
y=x^y
x=x^y
print(x,y)
# Method 5
x=x*y
y=x/y
x=x/y
print(x,y)
a,b=5,6
print(a,b)
a=a+b
b=a-b
a=a-b
print(a,b)
#program to swap indexes of present to succedinng one or viceversa
list=eval(input("enter a list"))
print(list)
a=len(list)
if a%2!=0:
a=a-1
for i in range(0,a,2):
list[i],list[i+1]=list[i+1],list[i]
print("swapped position and the list is",list)
def swap(a, b):
a = a + b
b = a - b
a = a - b
return a, b
pos1, pos2 = 1, 3