Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Osoba:
- def __init__(self, imie, nazwisko, pesel, rok_urodzenia, plec):
- self.imie = imie
- self.nazwisko = nazwisko
- if len(pesel) != 11:
- self.pesel = None
- else:
- self.pesel = pesel
- self.rok_urodzenia = rok_urodzenia
- self.plec = plec
- def wyswielt_o(self):
- print(self.imie)
- print(self.nazwisko)
- print(self.pesel)
- print(self.rok_urodzenia)
- print(self.plec)
- class Student(Osoba):
- def __init__(self, imie, nazwisko, pesel, rok_urodzenia, plec, numer_ind):
- super().__init__(imie, nazwisko, pesel, rok_urodzenia, plec)
- self.numer_indeksu = numer_ind
- def wyswietl_s(self):
- print("Imie i nazwisko: ", self.imie, self.nazwisko,
- "\nPesel: ", self.pesel, "\nRok urodzenia i płeć: ",
- self.rok_urodzenia, self.plec, "\nNumer Indeksu: ", self.numer_indeksu)
- class Wykladowca(Osoba):
- def __init__(self, imie, nazwisko, pesel, rok_urodzenia, plec, tytul):
- super().__init__(imie, nazwisko, pesel, rok_urodzenia, plec)
- self.tytul_naukowy = tytul
- def wyswietl_w(self):
- print("Imie i nazwisko: ", self.imie, self.nazwisko,
- "\nPesel: ", self.pesel, "\nRok urodzenia i płeć: ",
- self.rok_urodzenia, self.plec, "\nTytuł Naukowy: ", self.tytul_naukowy)
- class Stypendysta(Student):
- def __init__(self, imie, nazwisko, pesel, rok_urodzenia, plec, numer_1, kwota):
- super().__init__(imie, nazwisko, pesel, rok_urodzenia, plec, numer_1)
- self.kwota_stypendium = kwota
- def wyswietl_styp(self):
- print("Imie i nazwisko: ", self.imie, self.nazwisko,
- "\nPesel: ", self.pesel, "\nRok urodzenia i płeć: ",
- self.rok_urodzenia, self.plec, "\nNumer Indeksu: ", self.numer_indeksu,
- "\nKwota stypendium: ", kwota, "zł")
- kwota = int(input("Wprowadź kwotę stypendium "))
- #tytul = str(input("Wprowadź swój tytuł naukowy "))
- numer_ind = int(input("Wprowadz numer indeksu "))
- obiekt = Stypendysta("Adam", "Martyniak", "15893857228", 2000, "Mężczyza", numer_ind, kwota)
- obiekt.wyswietl_styp()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement