Created
January 8, 2020 22:44
-
-
Save Abdelkrim/b1ff1ef78a824bc3182003794dac8ad5 to your computer and use it in GitHub Desktop.
Python : Swap values between two variables
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Swap values between two variables | |
a = 5 | |
b = 10 | |
a, b = b, a | |
print(a) # 10 | |
print(b) # 5 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment