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



Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA