American Young Coder (AYC)

AYC logo
Loading Events

« All Events

  • This event has passed.

7 PM – Python OOP

December 3, 2021 @ 7:00 pm - 8:00 pm

Homework
  1. Under “src” folder, create monster.py
  2. Inside monster.py, create Monster class with the following attribute: species, health, max_attack
  3. Inside monster.py, create get_info() method.
  4. 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
  5. 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

Details

Date:
December 3, 2021
Time:
7:00 pm - 8:00 pm
Event Categories:
,
Verified by MonsterInsights