This is an archived version of the course. Please find the latest version of the course on the main webpage.

Chapter 6: Variables

Variable assignment

face Josiah Wang

As mentioned, Python variables are just labels for objects.

Therefore, you can have different variables pointing to the same object (an object can be given multiple names).

Multiple variables pointing to the same object

You are also free to reassign an existing variable to point to a different object (of any type) at any stage of your program.

Reassigning variables to different objects