Javatpoint Logo
Javatpoint Logo

Python program to swap two variables

Variable swapping:

In computer programming, swapping two variables specifies the mutual exchange of values of the variables. It is generally done by using a temporary variable.

For example:

After swapping:

See this example:

Output:

Python Basic Programs6



Please Share

facebook twitter google plus pinterest

Learn Latest Tutorials


Preparation


B.Tech / MCA