🧭Object (Programming)
Also known as Object, Instance, Class Instance
One real thing made from a class, with its own values. Also called an instance.
Think of it like
Think of it like one cookie from the cutter. It has the same shape as the others, but its own sprinkles.
Example
Jack makes two Dog objects, Rex and Bo. Giving Rex a new name leaves Bo exactly as he was.
Why it matters
Definition
Example code
python
>>> rex = Dog("Rex")
>>> rex.name
'Rex'Common mistake
Key takeaways
- 1Made from a class. Also called an instance.
- 2Its own values. Separate from the others.
- 3Use a dot. rex.name, rex.speak().