def swap(a,b): t=a a=b b=t x=10 y=20 print(" Before {:3d} and {:3d} ".format(x,y)) swap(x,y) print(" After {:3d} and {:3d} ".format(x,y)) x1=1.0 x2=2.0 print(" Before {:4.1f} and {:4.1f} ".format(x1,x2)) swap(x1,x2) print(" After {:4.1f} and {:4.1f} ".format(x1,x2))