fromqafunnypetimportQafunnypetclassDog(Qafunnypet):
def__init__(self, name, age, color=None):
super().__init__(name, age)
self.color=colordefpresent(self):
ifself.colorisNone:
passelse:
print(f"I am {self.name} and I am {self.age} years old and I am {self.color}")
defspeak(self):
print("Bark")
>>>doggy=Dog("Tim", 15, "Bronw")
>>>doggy.present()
>>>doggy.speak()
>>>some=Qafunnypet("Cuasi", 10)
>>>some.present()
>>>some.speak()
The Tidelift Subscription provides access to a continuously curated stream of human-researched and maintainer-verified data on open source packages and their licenses, releases, vulnerabilities, and development practices.