RBC interview question

How can make swap in python.