Untitled

mail@pastecode.io avatar
unknown
plain_text
a month ago
963 B
5
Indexable
Never
from abc import ABC, abstractmethod


class Zamestnanec(ABC, IPohybovatelne):
	def __init__(self, jmeno, prijmeni, email):
		self.jmeno = jmeno
		self.prijmeni = prijmeni
		self.email = email

	def pozdrav(self):
		return "cau"

	@abstractmethod
	def pracuj(self): #závazek pro potomky
		...

class Programator(Zamestnanec):
	def __init__(self, jmeno, prijmeni, email, prog_jazyk):
		super().__init__(jmeno, prijmeni, email)
		self.prog_jazyk = prog_jazyk

	def pracuj(self):
		return f"Programuju v jazyce {self.prog_jazyk}"

class Uklizec(Zamestnanec):
	def __init__(self, jmeno, prijmeni, email, oblibene_koste):
		super().__init__(jmeno, prijmeni, email)
		self.oblibene_koste = oblibene_koste

	def pracuj(self):
		return f"Svym kostetem {self.oblibene_koste} uklizim."	


p1 = Programator("Petr", "Novak", "novak@spsul.cz", "java")
p1.pracuj()
u1 = Uklizec("Alena", "Novotna", "nov@email.cz", "Nimbus2000")
u1.pracuj()
Leave a Comment