Nastiakot1
19.05.2023 18:02

1. Create a class called Cat. 2. Give it attributes for name, color, and weight.
3. Give it a method called meow.
(Python)​

Нажмите на рекламу ниже и сразу увидите ответ
Популярные вопросы:
Ответ:
kira9let
14.06.2021 08:18

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()


1. Create a class called Cat. 2. Give it attributes for name, color, and weight. 3. Give it a method
0,0(0 оценок)
Полный доступ
Позволит учиться лучше и быстрее. Неограниченный доступ к базе и ответам от экспертов и ai-bota Оформи подписку
logo
Начни делиться знаниями
Вход Регистрация
Что ты хочешь узнать?
Спроси ai-бота