Summary

We've looked at how we assign objects to variables. We've looked at the simple assignment statement, as well as multiple assignment and augmented assignment. With augmented assignment, we can update a variable by applying an operator and an operand. This is a handy syntactic shortcut.

We've also addressed the input() function, which is a way to create new objects based on user input. It's very handy for simple command-line scripts. More sophisticated GUIs, of course, will have considerably more sophisticated input mechanisms.

The concept of a namespace, and how variables are tracked via a namespace, is central to Python. When a namespace is no longer needed, it's discarded, removing all of the variables. This will also reduce the reference ...

Get Python Essentials now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.