From the course: Programming Concepts for Python

Unlock this course with a free trial

Join today to access over 24,800 courses taught by industry experts.

Object names

Object names

- As we create and use objects in our programs, we need a way to refer to them, and this can be accomplished by binding names to those objects. Take this shirt, for example. It's a solid color, so I'm going to use the name red shirt to refer to it. If I'm wearing the red shirt, that means I'm wearing this specific object. Now, red shirt itself is not an object. Red shirt is just a name that I use to refer to this specific object. And just like in real life, it's possible to have multiple names for the same object. - Ah, your crimson shirt, I like it. - As you can see, Olivia has a different name for my shirt. - It's a crimson shirt. - I'm not sure what crimson is, so I call this my red shirt. We have two different names that we use to refer to the same object, but there is only this one shirt. That means if I spill juice on the red shirt- - The crimson shirt is gross and sticky. And if I decide to toss the crimson…

Contents