 how to swap to variables in Python. In Python that is very easy. I'm gonna create two variables, variable A and variable B and then if we want to swap them then variable A is gonna become variable B and variable B is gonna become the variable A. Let's print variable A and variable B and let's run this code and as you can see these two variables are swapped.