Created
March 20, 2024 10:47
-
-
Save jacoor/503d0517baef9fa9ee64d70e80bb3213 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Pojazd: | |
def __init__(self, predkosc: int, kolor: str) -> None: | |
self.predkosc: int = predkosc | |
self.kolor: str = kolor | |
def jedz(self) -> None: | |
print("Pojazd jedzie.") | |
def zatrzymaj(self) -> None: | |
print("Pojazd zatrzymuje się.") | |
class Samochod(Pojazd): | |
def __init__(self, predkosc: int, kolor: str, ilosc_drzwi: int) -> None: | |
super().__init__(predkosc, kolor) | |
self.ilosc_drzwi: int = ilosc_drzwi | |
def otworz_drzwi(self) -> None: | |
print("Otwieranie drzwi samochodu.") | |
class Motocykl(Pojazd): | |
def __init__(self, predkosc: int, kolor: str, typ: str) -> None: | |
super().__init__(predkosc, kolor) | |
self.typ: str = typ | |
def wlacz_swiatla(self) -> None: | |
print("Włączanie świateł motocykla.") | |
class Rower(Pojazd): | |
def __init__(self, predkosc: int, kolor: str, typ: str) -> None: | |
super().__init__(predkosc, kolor) | |
self.typ: str = typ | |
def skladaj(self) -> None: | |
print("Składanie roweru.") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment