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.
- 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)
- Make sure to use the
__init__method to create these attributes. - Create a list of pets.
- Create a function that takes in a list of pets and prints out the name and the food attributes.
- Test your function with your list of pets.