Skip to content

Instantly share code, notes, and snippets.

@jacoor
Created March 20, 2024 10:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jacoor/503d0517baef9fa9ee64d70e80bb3213 to your computer and use it in GitHub Desktop.
Save jacoor/503d0517baef9fa9ee64d70e80bb3213 to your computer and use it in GitHub Desktop.
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