how to crete a class with dogs in python

Solutions on MaxInterview for how to crete a class with dogs in python by the best coders in the world

showing results for - "how to crete a class with dogs in python"
Damián
17 Jan 2021
1class Dogs():
2  name = ""
3  width = ""
4  height = ""
5  breed = ""
6  trick = ""
7  def __init__(self, name, width, height, breed, trick):
8    self.name = name
9    self.width = width
10    self.height = height
11    self.breed = breed
12    self.trick = trick
13  def getName(self):
14    return self.name
15  def getWidth(self):
16    return self.width
17  def getHeight(self):
18    return self.height
19  def getBreed(self):
20    return self.breed
21  def getTrick(self):
22    return self.trick
23Pet = Dogs(input("What is your dog's name: "), input("How wide is your dog: "), input("What is your dog's height: "), input("What is your dog's breed: "), input("What trick can your dog do: "))
24print(Pet.getName(), "is", Pet.getWidth(), "wide and", Pet.getHeight(), "long. It can", Pet.getTrick() + "!", Pet.getName(), "is a cool", Pet.getBreed() + "!!!")