Last active
January 27, 2018 08:31
-
-
Save VincentTam/edaf52b3a578552fa41fa5d800ca7065 to your computer and use it in GitHub Desktop.
Echange "pythonique" de deux nombres
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
# input | |
a = int(input("Donner la valeur de a: ")) | |
b = int(input("Donner la valeur de b: ")) | |
# avant échange | |
print("a = ",a) | |
print("b = ",b) | |
# échange | |
a, b = b, a | |
# après échange | |
print("a = ",a) | |
print("b = ",b) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment