Simultaneous Assignment

1.13. Simultaneous Assignment#

Simultaneous assignment is useful when you want to swap values. So instead of doing this:

  temp = x
  x = y
  y = temp

you can do this:

x, y = y, x