class Cat:
def __init__(self, name, color, weight):
self.name = name
self.color = color
self.weight = weight
def meow(self):
print("Cat name: " + self.name, "\nCat color: " + self.color, "\nCat weight: " + self.weight)
cat = Cat("Bella", "A grey striped tabby", "4.5 kg")
cat.meow()
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
class Cat:
def __init__(self, name, color, weight):
self.name = name
self.color = color
self.weight = weight
def meow(self):
print("Cat name: " + self.name, "\nCat color: " + self.color, "\nCat weight: " + self.weight)
cat = Cat("Bella", "A grey striped tabby", "4.5 kg")
cat.meow()