# Pet Example # Create a Pet class with with fields # name, animal_type, and methods # vaccinate, is_vaccinated. class Pet: # Initialize instance variables. def __init__(self, the_name, the_animal_type): self.name = the_name self.animal_type = the_animal_type self._vaccinated = False # Return Yes if pet is vaccinated, # No, otherwise. def is_vaccinated(self): if self._vaccinated: return "Yes" else: return "No" # Vaccinate pet. def vaccinate(self): self._vaccinated = True # Show pet as a string. def __str__(self): ret_val = f"Name: {self.name}\n" + \ f"Animal Type: {self.animal_type}\n" + \ f"Is Vaccinated: {self.is_vaccinated( )}\n" return ret_val