Homework
- Under “src” folder, create monster.py
- Inside monster.py, create Monster class with the following attribute: species, health, max_attack
- Inside monster.py, create get_info() method.
- Inside monster_system.py, add 3 monsters inside self.monster_dictionary.
- key = “dragon” , value = Monster class – species: dragon, health: 100, max_attack: 30
- key = “troll” , value = Monster class – species: troll, health: 50, max_attack: 20
- key = “water golem” , value = Monster class – species: water golem, health: 30 max_attack: 20
- Inside monster_system.py, add a new method display_all_monster(self): Inside this method, loop through all Monster inside the dictionary and print the monster.get_info()
Dragon - 100 health - 50 Max attack
Troll - 50 health - 20 Max attack
Water Gollem - 30 health - 20 Max attack
Enter your selection ('exit' to quit): dragon
Dragon - 100 health - 50 Max attack
Troll - 50 health - 20 Max attack
Water Gollem - 30 health - 20 Max attack
Enter your selection ('exit' to quit): troll
Dragon - 100 health - 50 Max attack
Troll - 50 health - 20 Max attack
Water Gollem - 30 health - 20 Max attack
Enter your selection ('exit' to quit): exit