American Young Coder (AYC)

AYC logo
Loading Events

« All Events

  • This event has passed.

7 PM – Python OOP – Gamas

December 18, 2023 @ 7:00 pm - 8:00 pm

Today We Did
  1. We learned about inheritance with Car and ElectricCar classes.
  2. We continued with MonsterInheritance adding feature where dragon is immune to fire magic and Troll is resistant with earth magic.
Homework
  1. No class until January 6th.
  2. Create a new file dragon.py. Inside this file create Dragon class that inherits from Monster class.
  3. Inside Dragon class create a method called magic_damage(self, damage, magic_type)
    1. Inside this method, add code that would make no damage where magic_type is “fire”. Otherwise damage the dragon regularly.
  4. Create a new file troll.py. Inside this file create Troll class that inherits from Monster class.
  5. Inside Troll class create a method called magic_damage(self, damage, magic_type)
    1. Inside this method, add code that would make half damage where magic_type is “earth”. Otherwise damage the dragon regularly.

Details

Date:
December 18, 2023
Time:
7:00 pm - 8:00 pm
Verified by MonsterInsights