super()
Not met yet
super() reaches the parent class's methods for this same object. A subclass that writes its own __init__ replaces the parent's, so call super().__init__(...) to let the parent set up its part. In an overriding method, super().give_back(hours) reuses the parent's work so the subclass only adds what differs.
Try it
main.pyOutput
Press Run and what your program prints shows up here.
Easy to get wrong
- Thinks the parent's __init__ still runs when a subclass writes its own __init__.
- Thinks super().method() calls the subclass's own version of the method again.