Question: 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
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
