Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

Swapping Variables

x = 10
y = 11


x, y = y, x
"Swapping by simultaneously creating a tuple and unpacking it"

print(x, y)
 
PREVIOUS NEXT
Tagged: #Swapping #Variables
ADD COMMENT
Topic
Name
5+2 =