Which are the 'object/s' in this example? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Which are the 'object/s' in this example?

Taken from the OOP lesson: Below is an example of a simple class and its objects. class Cat: def __init__(self, color, legs): self.color = color self.legs = legs felix = Cat("ginger", 4) rover = Cat("dog-colored", 4) stumpy = Cat("brown", 3)

20th Feb 2019, 2:27 PM
Clement
Clement - avatar
3 Answers
+ 3
You have the class Cat which is like a blueprint to create Cats. Your objects are felix, rover and stumpy. https://www.sololearn.com/learn/JUMP_LINK__&&__Python__&&__JUMP_LINK/2467/?ref=app
20th Feb 2019, 2:44 PM
Denise Roßberg
Denise Roßberg - avatar
+ 3
Clement Chiu You're welcome.
20th Feb 2019, 2:54 PM
Denise Roßberg
Denise Roßberg - avatar
+ 1
Denise Roßberg thanks I had to have it clarified because the term 'objects' had been regularly used after this yet I was confused which were the objects
20th Feb 2019, 2:48 PM
Clement
Clement - avatar