Skip to content

Latest commit

 

History

History
18 lines (13 loc) · 670 Bytes

File metadata and controls

18 lines (13 loc) · 670 Bytes

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 (e.g., dog, cat, fish)
  • Color (e.g., spotted, tabby, gold)
  • Food (e.g., kibbles, tuna, fish flakes)
  • Noise (e.g., meow, woof, splash)
  • Name (e.g., Scooby Doo, Fluffy, Bubbles)

Specifications

  1. Make sure to use the __init__ method to create these attributes.
  2. Create a list of pets.
  3. Create a function that takes in a list of pets and prints out the name and the food attributes.
  4. Test your function with your list of pets.