Question
We need to create PET class through THIS TEST HARNESS: #test harness garfield = Pet('Garfield', 3) x = 1 print( f '{x}:{garfield}') x = 2
We need to create PET class through THIS TEST HARNESS:
#test harness
garfield = Pet('Garfield', 3)
x = 1
print(f'{x}:{garfield}')
x = 2
print(f'{x}:{garfield.owner}')
garfield.set_owner('Jon')
x = 3
print(f'{x}:{garfield.owner}')
garfield.train()
x = 4
print(f'{x}:{garfield}')
#create a list with about 4 pets
pets = [garfield, Pet('Beethoven', 2), Pet('Jake'), Pet('Stuart', 7)]
for p in pets:
x += 1
print(f' {x}:{p}')
I WANT OUTPUT AS THIS:
1:Hi I am 3yrs and my name is Garfield.
I am not house trained and no one owns me.
2:no one
3:Jon
4:Hi I am 3yrs and my name is Garfield.
I am house trained and Jon owns me.
5:Hi I am 3yrs and my name is Garfield.
I am house trained and Jon owns me.
6:Hi I am 2yrs and my name is Beethoven.
I am not house trained and no one owns me.
7:Hi I am 5yrs and my name is Jake.
I am not house trained and no one owns me.
8:Hi I am 7yrs and my name is Stuart.
I am not house trained and no one owns me.
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