All problems
EasyPython Basics
Swap two variables
Swap the values of two variables without using a temporary variable.
- #variables
- #tuple-unpack
Sample input
a = 1, b = 2
Sample output
a=2 b=1
swap-vars.py
Output
Press "Run code" to execute.
Loading…
Swap the values of two variables without using a temporary variable.
a = 1, b = 2
a=2 b=1
Press "Run code" to execute.