-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathunnamed.py
49 lines (30 loc) · 1.19 KB
/
unnamed.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
43
44
45
46
47
48
class Clothing:
def __init__(self, color, size, style, price):
self.color = color
self.size = size
self.style = style
self.price = price
def change_price(self, price):
self.price = price
def calculate_discount(self, discount):
return self.price * (1 - discount)
def calculate_shipping(self, weight, rate):
return weight * rate
class Shirt(Clothing):
def __init__(self, color, size, style, price, long_or_short):
Clothing.__init__(self, color, size, style, price)
self.long_or_short = long_or_short
def double_price(self):
self.price = 2 * self.price
class Pants(Clothing):
def __init__(self, color, size, style, price, waist):
Clothing.__init__(self, color, size, style, price)
self.waist = waist
def calculate_discount(self, discount):
return self.price * (1 - discount / 2)
class Blouse(Clothing):
def __init__(self, color, size, style, price, country_of_origin):
Clothing.__init__(self, color, size, style, price)
self.country_of_origin = country_of_origin
def triple_price(self):
return 3 * self.price