x,y = 30,40
def swap(x,y):
x = x+y
y = x-y
x = x-y
print(x,y) #Here it swaps but as soon as function ends they go back to their previous values
swap(x,y)
print(x,y) #still prints x as 30 and y as 40
In C/C++ we used & operator to pass their addresses to make this change, how can we do the same thing in python considering python follows pass by object reference model?