Untitled
unknown
plain_text
2 years ago
286 B
6
Indexable
class Cat:
def __init__(self, name):
self.name = name
def kiss(self):
return f"{self.name} gives a sweet kitty kiss!"
# Create a cat instance
my_cat = Cat("Whiskers")
# Call the kiss method
kiss_message = my_cat.kiss()
# Print the result
print(kiss_message)
Editor is loading...
Leave a Comment