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

Commit cffc32d

Browse files
committed
Update headings
1 parent 5daec01 commit cffc32d

File tree

5 files changed

+153
-12
lines changed

5 files changed

+153
-12
lines changed

README-PYTHON-HOMEWORKS.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,10 @@
120120
## TP08
121121
- Date, Time, Format
122122
- Math
123+
- def, lambda
124+
- argv, kwargs
123125
- Inheritance
126+
- Decorator
124127
- NumPy
125128
- ...
126129

README.md

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@
104104
</details>
105105
15. [Comperhension](/lessons/python/concepts/collections/comperhension.py)
106106
16. Scope, Globals, Locals
107-
- [`locals(), globals()`](/lessons/python/concepts/variables/scope.py)
107+
- [`locals(), globals()`](/lessons/python/concepts/variables/scope.py)
108108
17. [Read File, Write File](/lessons/python/examples/sample/file/read-write-file.py), [Pickle](/lessons/python/examples/sample/file/read-write-pickle.py)
109109
18. Math
110110
19. [Date, Time](/lessons/python/concepts/date-time/date-time.py)
@@ -124,24 +124,25 @@
124124
- Python does not support function overloading
125125
- [Operator Overloading](/lessons/python/concepts/operators/operator-overload.py) <sub>[OPTIONAL]</sub>
126126
- Getter, Setter ???
127+
- [Enum](/lessons/python/concepts/enum/color-enum.py)
128+
1. [Eval, Exec](/lessons/python/concepts/advanced/eval-exec.py)
129+
1. [Generator](/lessons/python/concepts/advanced/simple-generator.py)
130+
1. [Assertion](/lessons/python/concepts/advanced/simple-assertion.py)
131+
1. PIP
132+
- [`install, list, uninstall, freeze`, ...](/lessons/python/installation/README-PIP.md)
133+
1. [Decorator](/lessons/python/concepts/advanced/simple-decorator.py)
134+
127135

128136
### Optional
129137
1. VENV
130-
2. PIP
131-
- [`install, list, uninstall, freeze`, ...](/lessons/python/installation/README-PIP.md)
132-
3. [Enum](/lessons/python/concepts/enum/color-enum.py)
133138
4. Arguments
134139
- [`*argv`, `**kwargs`](/lessons/python/concepts/advanced/argv-kwargs.py)
135-
5. [Eval, Exec](/lessons/python/concepts/advanced/eval-exec.py)
136140
7. Exception
137141
1. Custom Exception
138142
2. Types of Errors
139-
8. [Assertion](/lessons/python/concepts/advanced/simple-assertion.py)
140-
9. [Decorator](/lessons/python/concepts/advanced/simple-decorator.py)
141143
10. Meta
142144
1. Meta Classes
143145
2. Meta Programming
144-
11. [Generator](/lessons/python/concepts/advanced/simple-generator.py)
145146
12. Iterator
146147
- [Iterator, Iterable](/lessons/python/concepts/advanced/simple-iterator.py)
147148
- [Custom Iterator](/lessons/python/concepts/advanced/custom-iterator.py)

lessons/python/_.html

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
4+
<head>
5+
<meta charset="UTF-8">
6+
<meta http-equiv="X-UA-Compatible" content="IE=edge">
7+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
8+
<title>Document</title>
9+
<style>
10+
p {
11+
color: #212121;
12+
font-weight: bold;
13+
display: inline-block;
14+
}
15+
16+
li {
17+
color: #212121;
18+
}
19+
20+
span {
21+
color: royalblue;
22+
font-weight: bold;
23+
}
24+
25+
mark{
26+
padding: .5em;
27+
border-radius: 10em;
28+
}
29+
</style>
30+
</head>
31+
32+
<body>
33+
<ol>
34+
<li>
35+
<mark>3</mark>
36+
<p>Difference between</p> <span>List, Tuple, Set, Dict</span>
37+
<p>?</p>
38+
</li>
39+
<li>
40+
<mark>1</mark>
41+
<p>Explain about each of these methods and tell when it is necessary to use them?</p><span>.upper(),
42+
.lower(), .replace()</span>
43+
</li>
44+
<li>
45+
<mark>1</mark>
46+
<span>Mutable</span>
47+
<p>vs</p> <span>Immutable</span>
48+
<p>?</p>
49+
</li>
50+
<li>
51+
<mark>1</mark>
52+
<span>Convert</span>
53+
<p>vs</p> <span>TypeCast</span>
54+
<p>?</p>
55+
</li>
56+
<li>
57+
<mark>1</mark>
58+
<span>return</span>
59+
<p>vs</p> <span>yield</span>
60+
<p>in function?</p>
61+
</li>
62+
<li>
63+
<mark>2</mark>
64+
<p>Explain about</p>
65+
<span>try</span><p>,</p>
66+
<span>except</span><p>,</p>
67+
<span>else</span><p>,</p>
68+
<span>finally</span>
69+
<p>.</p>
70+
</li>
71+
<li>
72+
<mark>1</mark>
73+
<p>When do we use</p>
74+
<span> in </span><p>and</p>
75+
<span> is </span><p>keywords?</p>
76+
</li>
77+
<li>
78+
<mark>1</mark>
79+
<p>Explain about</p>
80+
<span> zip() </span><p>and</p>
81+
<span> enumerate() </span><p>functions.</p>
82+
</li>
83+
84+
<li>
85+
<mark>1</mark>
86+
<p>Name four Python <span>modules</span> and tell us when we use them?</p>
87+
</li>
88+
89+
<li>
90+
<mark>1</mark>
91+
<p>Name one of the <span>random</span> methods and tell how it works?</p>
92+
</li>
93+
</ol>
94+
</body>
95+
96+
</html>

lessons/python/concepts/advanced/simple-decorator.py

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,3 +48,42 @@ def calc(*args):
4848
calc(1)
4949
calc(1, 2)
5050
calc(1, 2, 3, 4, 5)
51+
52+
53+
###~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
54+
def check_type_decorator(func):
55+
def inner(*args):
56+
for a in args:
57+
print(a, type(a))
58+
return func(*args)
59+
60+
return inner
61+
62+
63+
@check_type_decorator
64+
def my_mean_function(a: int, b: int, c: int):
65+
return (a + b + c) / 3
66+
67+
68+
print(my_mean_function(4, 5, 6))
69+
70+
71+
###~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
72+
def clean_input_decorator(func):
73+
def inner(*args):
74+
L = list(args)
75+
for index, arg in enumerate(L):
76+
L[index] = arg.replace(" ", "")
77+
return func(*L)
78+
79+
return inner
80+
81+
82+
@clean_input_decorator
83+
def f1(a, b, c):
84+
print(a)
85+
print(b)
86+
print(c)
87+
88+
89+
f1(" hello ", "hello world", "good bye")
Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1-
from datetime import datetime,date,time
1+
from datetime import datetime, date, time
22

3-
print(datetime.now())
4-
print(date(2020,12,10))
5-
print(time(hour=12,minute=31))
3+
print(datetime.now())
4+
print(date(2020, 12, 10))
5+
print(time(hour=12, minute=31))
6+
7+
print(datetime.now().strftime("%Y - %m - %d --- %H:%M':%S\""))

0 commit comments

Comments
 (0)