Skip to content

Instantly share code, notes, and snippets.

@VincentTam
Last active January 27, 2018 08:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save VincentTam/edaf52b3a578552fa41fa5d800ca7065 to your computer and use it in GitHub Desktop.
Save VincentTam/edaf52b3a578552fa41fa5d800ca7065 to your computer and use it in GitHub Desktop.
Echange "pythonique" de deux nombres
# 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