Swapping variables techniques using Python

preview_player
Показать описание
There are three ways to swap the contents of variables using Python. The video demonstrates the following techniques.
1. Using temporary variable.
2. Addition and Subtraction.
3. XOR Operator.

Рекомендации по теме
Комментарии
Автор

Quality content with simple explanation how to swap numbers and bitwise operation,
One more option to swap
a, b=b, a

jeevanchavan