Create Class Attribute Speciesof Type Strto Shared Instances Class Dogand Set Value Canis Q37051989

Create a class attribute speciesof type strtobe shared by all instances of the class Dogand set itsvalue to ‘canis familiaris’. The class attributespeciesshould be defined within the class Dogbutoutside of any method.

>>> dog.Dog.species
‘Canis familiaris’
>>> sugar.species
‘Canis familiaris’


Answer


Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.