🐾 Pet Shop · Mission 6 of 6

👑 Playtime

Boss mission! Playing uses up energy. Teach every Pet how to play, then let them all play together.

Your mission

  1. Use your Pet class, and pets = [Pet("Tom"), Pet("Bella", "dog", 8), Pet("Coco", "rabbit", 2)].
  2. Give Pet a method play(minutes): energy goes down by minutes, but never below 0. If it reaches 0, say "<name> needs a nap!"
  3. Ask "How many minutes of play?", then run p.play(minutes) for every pet.

Getting the mission ready…