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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!