-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdeal.py
24 lines (18 loc) · 835 Bytes
/
deal.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
from abc import ABC
class Sell(ABC):
def __init__(self, price_per_meter, discountable=False, convertable=False, *args, **kwargs):
self.price_per_meter = price_per_meter
self.discountable = discountable
self.convertable = convertable
super().__init__(*args, **kwargs)
def show_price(self):
print(f'sell {self.price_per_meter}')
class Rent(ABC):
def __init__(self, initial_price, monthly_price, discountable=False, convertable=False, *args, **kwargs):
self.initial_price = initial_price
self.monthly_price = monthly_price
self.discountable = discountable
self.convertable = convertable
super().__init__(*args, **kwargs)
def show_price(self):
print(f'initial price: {self.initial_price} \t monthly_price {self.monthly_price}')