class Dog:
def __init__(self, dogName, dogBreed):
self.dogName = dogName
self.dogBreed = dogBreed
def bark(self):
print("Woof Woof Woof!")
def printdogName(self):
print("dogName is {self.dogName} and dogBreed is {self.dogBreed}.")
dog1 = Dog("pppp", "Golden Retriever")
dog2 = Dog("bbbb", "Labrador Retriever")
dog1.bark()
dog2.printdogName()
class Cat:
ReplyDeletedef __init__(self, catName, catBreed):
self.catName = catName
self.catBreed = catBreed
def meow(self):
print("Meow Meow Meow!")
def printcatName(self):
print("catName is {self.catName} and catBreed is {self.catBreed}.")
cat1 = Cat("cccc", "Ginger")
cat2 = Cat("kkkk", "Mix")
cat1.meow()
cat2.printcatName(
- Srijan