def swap(a,b): temp = a # spara a i temp a = b # kopiera b till a b = temp # kopiera temp till b return [a,b] # returnerar en referens till en lista x = 7 y = 5 lis = swap(x,y) # lis pekar på en lista x=lis[0] #tup[0] y=lis[1] #tup[1] print('Swaped: x=',x, ' ' 'y=',y)