Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
first = 'Jimmy'
second = 'Johny'
print('Before Swapping',first, second) # Jimmy Johny
first, second = second, first # swaps the variables
print("After swapping:", first, second) # Johny Jimmy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment