Lesson 4. Variables and expressions: giving names and values to things

After reading lesson 4, you’ll be able to

  • Write code that creates Python objects
  • Write code that assigns objects to variables

In your everyday life, you encounter many physical objects, or things. Each of these things has a name. They have names because it’s much easier to refer to them using a name rather than a description.

Using names is a great help when you’re always manipulating things, or objects. Some things are simple, such as the number 9. Some are more complicated, such as a dictionary. I can give the name Nana to the number 9, and the name Bill to my dictionary. You can give things (almost) any name you want. You can even give names to combinations of things. ...

Get Get Programming 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.