Advertisement
Zadyk

Untitled

Aug 4th, 2019
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.18 KB | None | 0 0
  1. class Building:
  2.  
  3.     def __init__(self, adress, nb_stairs):
  4.         self.adress = adress
  5.         self.stairs = nb_stairs
  6.  
  7.     def get_adress(self):
  8.         return self.adress
  9.  
  10.     def stairs(self):
  11.         return self.stairs
  12.  
  13.  
  14. class Residence(Building):
  15.  
  16.     def __init__(self, adress, nb_stairs, balcony):
  17.         Building.__init__(nb_stairs,adress,)
  18.         self.nb_balcony = balcony
  19.  
  20.     def get_nb_balcons(self):
  21.         return self.nb_balcony
  22.  
  23.  
  24. class Supermarket(Building):
  25.  
  26.     def __init__(self, adress, nb_stairs, nb_rayons):
  27.         Building.__init__(adress, nb_stairs)
  28.         self.nb_rayons = nb_rayons
  29.  
  30.     def get_nb_rayons(self):
  31.         return self.nb_rayons
  32.  
  33.  
  34. class Bank(Building):
  35.  
  36.     def __init__(self, adress, nb_stairs, chest, name):
  37.         Building.__init__(adress, nb_stairs)
  38.         self.nb_chest = chest
  39.         self.name = name
  40.  
  41.     def get_nb_chest(self):
  42.         return self.nb_chest
  43.  
  44.     def get_name(self):
  45.         return self.name
  46.  
  47.  
  48. #4 buildings
  49. residence1 = Residence("26 galere de nulle part", 2, 1,)
  50. #Supermarket
  51. supermarket1 = Supermarket("33 av des fleurs", 2, 59)
  52. #Bank
  53. bank1 = Bank("44 rue ptain merde)", 3,2, "Voleur",)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement