Lab 7.02 - Pet Class

In this lab we will create a Pet class that will keep track of the type of animal, color, food, noise and name of a given animal.

  1. Create a class called Pet that has the following attributes:
    • Animal (i.e. dog, cat, fish)
    • Color (i.e. spotted, black, tabby, white)
    • Food (i.e. kibbles, tuna, fish flakes)
    • Noise (i.e. meow, woof, bark)
    • Name (i.e. Sparky, Scooby Doo)
  2. Make sure to use the __init__ method to create these attributes.
  3. Create a list of pets.
  4. Create a function that takes in a list of pets and prints out the name and the food attributes.
  5. Test your function with your list of pets.