Introducing Python © Chirag Wazir 2002 Prev   Index   Next

Assignment

a = 1
a += 1
a = b = c = 1
(a, b, c) = (1, 2, 3)
(a, b) = (b, a)

Notes:

  1. Assignment simply creates a reference to an object
  2. Assignment is not an expression