Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Ksiazka:
- '''
- Obiekt ksiazka opisuje wlasnosci ksiazek
- Args:
- tytul(str)
- autor(str)
- rok_wydania(int)
- oprawa(str)
- ISBN(int)
- cena(float)
- kategoria(str)
- wydawnictwo(str)
- Attributes:
- tytul:Zawiera informacje o tytule ksiazki
- autor:Zawiera informacje o autorze
- rok_wydania:Zawiera informacje o roku wydania
- oprawa:zawiera informacje o oprawie
- ISBN:Zawiera informacje o identyfikatorze książki
- cena:Zawiera informacje o cenie ksiazki
- kategoria:Zawiera informacje o kategorii ksiazki
- wydawnictwo:Zawiera informacje o wydawnictwie ksiazki
- '''
- def __init__(self,tytul,autor,rok_wydania,oprawa,ISBN,cena,kategoria,wydawnictwo):
- self.tytul = tytul
- self.autor = autor
- self.rok_wydania = rok_wydania
- self.oprawa = oprawa
- self.ISBN = ISBN
- self.cena = cena
- self.kategoria = kategoria
- self.wydawnictwo = wydawnictwo
- def get_tytul(self):
- return self.tytul
- def get_autor(self):
- return autor.umaszczenie
- def get_rok_wydania(self):
- return self.rok_wydania
- def get_oprawa(self):
- return self.oprawa
- def get_ISBN(self):
- return self.ISBN
- def get_cena(self):
- return self.cena
- def get_kategoria(self):
- return self.kategoria
- def get_wydawnictwo(self):
- return self.wydawnictwo
- def set_tytul(self, x):
- if isinstance(x, str):
- self.tytul = x
- else:
- raise TypeError("Marka powinna byc w typie STR")
- def set_autor(self, x):
- if isinstance(x, str):
- self.autor = x
- else:
- raise TypeError("Pojemnosc powinna byc w int")
- def set_rok_wydania(self, x):
- if isinstance(x, str):
- self.rok_wydania = x
- else:
- raise TypeError("Kolor powinien byc w str")
- def set_oprawa(self, x):
- if isinstance(x, int):
- self.oprawa = x
- else:
- raise TypeError("Kolor powinien byc w str")
- def set_ISBN(self, x):
- if isinstance(x,int):
- self.ISBN = x
- else:
- raise TypeError("Zmienna powinna byc INT")
- def set_cena(self, x):
- if isinstance(x,int):
- self.cena = x
- else:
- raise TypeError("Zmienna powinna byc INT")
- def set_kategoria(self, x)
- if isinstance(x,str):
- self.kategoria = x
- else:
- raise TypeError("Zmienna powina byc STR")
- def set_wydawnictwo(self, x)
- if isinstance(x,str):
- self.wydawnictwo = x
- else:
- raise TypeError("Zmienna pwinna byc STR")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement