American Young Coder (AYC)

AYC logo
Loading Events

« All Events

  • This event has passed.

6 PM – Python OOP – Gamas

January 4 @ 6:00 pm - 7:00 pm

Homework

Continue on Monster Inheritance project, make sure that the program can do the following

  1. Create a monster.py inside it will have Monster class.
  2. Inside Monster class it will have 3 attributes: species, health and max_attack.
  3. Inside Monster class it will have get_info method when you call it will return something – “<species> has <health> health points and <max_attack> max attack”
  4. Add codes inside the main.py so it can do the following. Make sure to store the monsters inside a dictionary.
  5. 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 MONSTER
    Enter monster species: Unicorn
    Enter monster health: 70
    Enter monster max_attack: 70
    You have added Unicorn 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 - 100 health - 100 Max attack
    - Troll - 50 health - 75 Max attack
    - Water Golem - 50 health - 50 Max attack
    - Unicorn - 70 health - 70 Max attack
    
    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: 3
    Enter your name: Gamas
    Enter player's health: 100
    Hi Gamas, Welcome to AYC Logic Adventure Game
    
    Gamas you have 100 health remaining.
    Please choose your monster: 
    - Dragon - 100 health - 100 Max attack
    - Troll - 50 health - 75 Max attack
    - Water Golem - 50 health - 50 Max attack
    - Unicorn - 70 health - 70 Max attack
    Enter your selection (enter 'stop' to quit the game):

     

  6. Create jan_4_class_inheritance_homework.py
    1. Page 168 to 170: Copy Codes
    2. Page 173, 9-6 and 9-7

Details

Date:
January 4
Time:
6:00 pm - 7:00 pm
Verified by MonsterInsights