An assignment statement evaluates a sequence expression and assigns each item of the sequence to one of the variables on the left. If there is a mismatch between the number of variables on the left and the values in the sequence on the right of the statement, then an exception is raised at runtime.

Ensure that the number of variables on either side of the assignment match.

The following examples show a simple definition of the Fibonacci series. In the first example, one of the values in the assignment has been duplicated, causing an exception at runtime.

  • Python Language Reference: Assignment statements.
  • Python Tutorial: First steps towards programming.