-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathestate.py
41 lines (31 loc) · 1.15 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
from abc import ABC, abstractmethod
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}\t area: {self.area}")
class House(EstateAbstract):
def __init__(self, has_yard, floor_count, *args, **kwargs):
self.has_yard = has_yard
self.floor_count = floor_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}")