Answered step by step
Verified Expert Solution
Question
1 Approved Answer
The Pet class constructor has a self parameter and three additional parameters: age, breed, and type. Input values age 1 , breed 1 , type
The Pet class constructor has a self parameter and three additional parameters: age, breed, and type. Input values age breed type age breed and type are read representing the information of two pets. Instantiate two new instances of Pet by completing the following tasks:
Assign pet with an instance of Pet with age as age, breed as breed, and type as type.
Assign pet with an instance of Pet with age as age, breed as breed, and type as type.
Click here for example
Ex: If the input is:
Doberman
dog
Bulldog
cat
then the output is:
pet data: months old, Doberman, dog
class Pet:
def initself age, breed, type:
self.age age
self.breed breed
self.type type
age intinput
breed input
type input
age intinput
breed input
type input
Your code goes here
printfpet data: petage months old, petbreedpettype
printfpet data: petage months old, petbreedpettypet data: months old, Bulldog, cat
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started