- This event has passed.
7:00 PM – Python OOP – Joshua
September 12 @ 7:00 pm - 8:00 pm
Today we did
– Dictionary Practice
– robux review
Homework (We will go over in class with however much you complete)
- Let’s create a Zoo system simlar to your library system
- Create a dictionary called zoo.
- The dictionary’s key: value pair will be animal_name: If they are hungry (True False)
- create a menu string with two options: Add the Animal , and feed the animal and use a while loop (similar to grocery store/library system) to create an application.
- Add Animal: this option. will give a name, and adds a animal to the dictionary
- Feed animal: this option will list all the animals that are hungry (False). It will then ask you which one you want to feed. when you give it the right animal, it should feed the animaly (convert it from false to true)
- Bonus test: Every single round, there should be a 1/5 chance for a random animal to be come hungry. False
Structure:
1. Menu string = “”” “””
2. zoo_dictionary
3. While loop with an if statement for the two options, plus an “exit” condition ( ex. if they type brea, you should quit)