« All Events
4:30 PM – Python OOP – Gamas
May 3, 2022 @ 4:30 pm - 5:30 pm
Today We Do
- We learned about Car and ElectricCar class inheritance.
- We learned about Monster and Dragon class inheritance.
Homework
- Inside Dragon class, override sword_damage method. Inside this method, it will not do any damage to the dragon. And it will say “Dragon is immune to sword attack. No damage is done” . Look at how we override fill_up_gas_tank in ElectricCar class for an example.
- Create a Troll class, make it inherits from Monster class. And then override sword_damage method. Inside this method, it will do half damage to the Troll. And it will say “Troll is resistance to sword attack. Damage is halved” .
- Review how we use dictionary inside MonsterInheritance class and ask question next week.