Lab
In this lab we will build off of our pet class. To create a Pet class that will keep track of the type of animal, color, food, noise and name of a given animal. We will utilize classes.
- Create a class called Pet. That will have the following attributes:
- type (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