Question: I need help fixing my code. IN PYTHON 3. I have two seperate files: main.py and pet.py. I imported pet into main, so I could


Current file: main.py Load default template... 1 2 #Create your main code here 5 import pet 7 pet_owner - input("Please enter owner's name :") 8 Pet. pet owner - pet owner 9 pet_list - Il 10 while True: pet_name - input("Please enter the pet's nane") if pet_name - 'q' or pet_name -- 'Q: break age - int(input("Please enter the pet's age")) pet - Pet (pet name, age) pet list.append(pet) 17 print("Pet List:) 18 for pet in pet list: 19 print (pet) 13 Current file: pet.py - Load default template... 1 2 - Create your Pet class here class Pet: pet owner - "X" def __init_(self, name, age): self.pet_name = name self.pet_age - age def str (self): var - "{@) is {1} year(s) old and is owned by (2)".Format(self.pet_name, self.pet_age, Pet.pet_owner) return var Compare output Output differs. See highlights below. Sam I am Good Boi Input Jackson Your output ends with enter owner's name : Traceback (most recent call last): File "main.py", line 8, in
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
