I am receiving, this error please help:
Traceback (most recent call last):
File ".class practice2.py", line 18, in <module>
kitty.meow('jelly')
TypeError: 'str' object is not callable
class Cat():
def __init__(self,breed,color,meow,name):
self.breed = breed
self.color = color
self.meow = meow
self.name = name
def meow(self,snack):
print(f"MEOW, My name is {self.name} and my favorite snack is {snack}")
kitty = Cat('Maine Coon', 'White and black','ugly','kitty')
cat = Cat('Unknown','Grey', 'Ugly', 'cat')
kitty.meow('jelly')
cat.meow('meat')
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…