On the flip side, sometimes you’ll be working with a derived class (or subclass) and realize that you’ve overwritten a method or attribute defined in that class’ base class (also called a parent or superclass) that you actually need. Have no fear! You can directly access the attributes or methods of a superclass with Python’s built-in
The syntax looks like this:
class Derived(Base): def m(self): return super(Derived, self).m()
m() is a method from the base class.
First, inside your
- Add a new method called
full_time_wagewith the arguments
- That method should
returnthe result of a
supercall to the
PartTimeEmployee‘s parent class. Use the example above for help.
Then, after your class:
- Create an instance of the
milton. Don’t forget to give it a name.
full_time_wagemethod. You should see his wage printed out at $20.00 per hour! (That is, for
10hours, the result should be