Skip to content
This repository was archived by the owner on Aug 11, 2023. It is now read-only.

Commit 2cbc047

Browse files
committed
Update
1 parent 22af9d7 commit 2cbc047

File tree

2 files changed

+33
-13
lines changed

2 files changed

+33
-13
lines changed

README-PYTHON-HOMEWORKS.md

-5
Original file line numberDiff line numberDiff line change
@@ -100,11 +100,6 @@
100100
- Solve 2 ([**link**](/lessons/python/exercises/exercise-general-week-08-012--02.py))
101101
- Solve 3 ([**link**](/lessons/python/exercises/exercise-general-week-08-012--03.py))
102102
- Solve 4 ([**link**](/lessons/python/exercises/exercise-general-week-08-012--04.py))
103-
- Solve 5 ([**link**](/lessons/python/exercises/exercise-general-week-08-012--05.py))
104-
- Solve 6 ([**link**](/lessons/python/exercises/exercise-general-week-08-012--06.py))
105-
- Solve 7 ([**link**](/lessons/python/exercises/exercise-general-week-08-012--07.py))
106-
- Solve 8 ([**link**](/lessons/python/exercises/exercise-general-week-08-012--08.py))
107-
- Solve 9 ([**link**](/lessons/python/exercises/exercise-general-week-08-012--09.py))
108103
</details>
109104

110105

lessons/python/exercises/exercise-general-week-08-012--01.py

+33-8
Original file line numberDiff line numberDiff line change
@@ -82,16 +82,41 @@ class Product(Reflector):
8282
variant: Variant
8383
brand: Brand
8484

85+
def __init__(self, brand: Brand, cloth: Cloth, variant: Color) -> None:
86+
super().__init__()
87+
self.brand = brand
88+
self.cloth = cloth
89+
self.variant = variant
90+
8591

8692
V = {
87-
1001: Variant(Size.FREE_SIZE,Color.BLACK),
88-
1002: Variant(Size.FREE_SIZE,Color.GRAY),
89-
1003: Variant(Size.MEDIUM,Color.BLACK),
90-
1004: Variant(Size.MEDIUM,Color.BLUE),
91-
1005: Variant(Size.X_LARGE,Color.MULTICOLOR),
92-
1006: Variant(Size.X_SMALL,Color.MULTICOLOR),
93+
1001: Variant(Size.FREE_SIZE, Color.BLACK),
94+
1002: Variant(Size.FREE_SIZE, Color.GRAY),
95+
1003: Variant(Size.MEDIUM, Color.BLACK),
96+
1004: Variant(Size.MEDIUM, Color.BLUE),
97+
1005: Variant(Size.X_LARGE, Color.MULTICOLOR),
98+
1006: Variant(Size.X_SMALL, Color.MULTICOLOR),
9399
}
94100

95-
C= {
96-
2001:Cloth("Round Hat",Type.HAT)
101+
102+
C = {
103+
2001: Cloth("Round", Type.HAT),
104+
2002: Cloth("Cowboy", Type.HAT),
105+
2003: Cloth("Cap", Type.HAT),
106+
2004: Cloth("Long", Type.SHIRT),
107+
2005: Cloth("Long", Type.SKIRT),
97108
}
109+
110+
111+
L = [
112+
Product(Brand.BRAND_A, C[2003], V[1003]),
113+
Product(Brand.BRAND_A, C[2003], V[1004]),
114+
Product(Brand.BRAND_B, C[2004], V[1003]),
115+
Product(Brand.BRAND_B, C[2005], V[1003]),
116+
Product(Brand.BRAND_C, C[2004], V[1005]),
117+
Product(Brand.BRAND_C, C[2005], V[1006]),
118+
]
119+
120+
121+
for product in L:
122+
print(product)

0 commit comments

Comments
 (0)