-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathestate.py
42 lines (31 loc) · 1.13 KB
/
estate.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
from abc import abstractmethod, ABC
class EstateAbstract(ABC):
def __init__(self, user, area, rooms_count, built_year, region, address, *args, **kwargs):
self.user = user
self.area = area
self.rooms_count = rooms_count
self.built_year = built_year
self.region = region
self.address = address
super().__init__(*args, **kwargs)
@abstractmethod
def show_description(self):
pass
class Apartment(EstateAbstract):
def __init__(self, has_elevator, has_parking, floor, *args, **kwargs):
self.has_elevator = has_elevator
self.has_parking = has_parking
self.floor = floor
super().__init__(*args, **kwargs)
def show_description(self):
print(f'apartment {self.id}')
class House(EstateAbstract):
def __init__(self, has_yard, floors_count, *args, **kwargs):
self.has_yard = has_yard
self.floors_count = floors_count
super().__init__(*args, **kwargs)
def show_description(self):
print(f'house {self.id}')
class Store(EstateAbstract):
def show_description(self):
print(f'store {self.id}')