

0 / 2 embers
0 / 3000 xp
click for more info
Complete a lesson to start your streak
click for more info
Difficulty: 4
click for more info
Not enough gems
Cost: 6 gems
1: Inheritance
incomplete
2: When to Inherit
incomplete
3: Inheritance Hierarchy
incomplete
4: Inheritance Quiz
incomplete
5: Multiple Children
incomplete
6: Adding a Wizard
incomplete
7: Wide Not Deep
incomplete
8: Dragons
incomplete
9: Dragons Fight
incomplete
10: Inheritance Practice
incomplete
11: Inheritance Practice
incomplete
Back
ctrl+,
Next
ctrl+.
This lesson's interactive features are locked, please to keep using them
Example of inheritance in code:
class RealEstate:
def __init__(self, location: str) -> None:
self.__location = location
class Residential(RealEstate):
def __init__(self, location: str, bedrooms: int) -> None:
super().__init__(location)
self.__bedrooms = bedrooms
class House(Residential):
def __init__(self, location: str, bedrooms: int, yard_size: int) -> None:
super().__init__(location, bedrooms)
self.__yard_size = yard_size