Question: HELP WITH THIS PYTHON PROGRAM PLEASE! Write a class named Pet, which should have the following data attributes: name (for the name of a pet)
Write a class named Pet, which should have the following data attributes: name (for the name of a pet) . type (for the type of animal that a pet is. Example values are Dog Cat, and 'Bird) The Pet class should have an init method that initialize these data attributes. The Pet class should also have setter and getter methods for both of the data attributes. Additionally, the Pet class should have a make sound method which prints Then, write a main program that creates a Pet instance (specifically, a bird named "Captain"), and call the appropriate method to have him making the sound. For your reference, I attached the Automobile class which has appeared in exercises before: class Automobile: def init (self, make, model, mileage): self._ _make make self. model model self.__mileage mileage . (self, make, model, mileage: def set make(self, make): self _make make def set model(self, model): self. model model def set mileage(self, mileage): self. mileage mileage def get make(self): return self. make def get model(self): return self. model def get mileage(self): return self. mileage
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
