« All Events
7 PM – Python OOP – Gamas
November 13, 2023 @ 7:00 pm - 8:00 pm
Today We Did
- We continued on Library System.
- We added Book.get_info() method.
- We did find book by name.
Homework
- Create a new pycharm project MonsterInheritance
- In this new project,
- create a new file monster.py and a class Monster with 3 attributes: species, health, max_damage.
- create a new file main.py that will run and start the program. Similar to school system.
- Inside main.py, create a new dictionary self.monster_dictionary
- Immediately add 3 monsters to the dictionary:
- Dragon – health 100, max damage 100
- Troll – health 50, max damage 75
- Water Golem – 50 health, max damage 50.
- The program should behave like the following. Just do feature 1 and 2.
Welcome to AYC Logic adventure game
1. Add new monster
2. List all monsters
3. Start adventure
Please make your selection. Enter "quit" to exit: 2
LIST ALL MONSTERS
- Dragon has 100 health and can do 100 damage
- Troll - 50 health - 75 max damage
- Water Golem - 50 health - 50 max damage
Welcome to AYC Logic adventure game
1. Add new monster
2. List all monsters
3. Start adventure
Please make your selection. Enter "quit" to exit: 1
ADD NEW MONSTER
Enter monster species: Griffin
Enter monster health: 50
Enter monster max damage: 50
You have successfully added Griffin into our system.
Welcome to AYC Logic adventure game
1. Add new monster
2. List all monsters
3. Start adventure
Please make your selection. Enter "quit" to exit: 2
LIST ALL MONSTERS
- Dragon has 100 health and can do 100 damage
- Troll - 50 health - 75 max damage
- Water Golem - 50 health - 50 max damage
- Griffin - 50 health - 50 max damage
Welcome to AYC Logic adventure game
1. Add new monster
2. List all monsters
3. Start adventure
Please make your selection. Enter "quit" to exit: