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 Quiz

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