Updating VariablesΒΆ

x = x + 1



(ch07_update1)

If you try to update a variable that doesn’t exist, you get an error because Python evaluates the expression on the right side of the assignment operator before it assigns the resulting value to the name on the left.

Next Section - Exercises