We're sorry but this app doesn't work properly without JavaScript enabled. Please enable it to continue.

This lesson's interactive features are locked, please to keep using them

Inheritance Practice

Siege weapons (battering rams, catapults, etc.) are special units in Age of Dragons. Let's write the logic for how they move around the map.

Assignment

Complete the Siege, BatteringRam, and Catapult classes:

Tips

The super() function gives you access to the parent class, so you can call its constructor and any of its other methods:

class Child(Parent):
    def some_method(self, x: int) -> int:
        base = super().some_method(x)
        return base + 1