250x250
Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
Tags
- randrange()
- remove()
- __annotations__
- Database
- MySqlDB
- fileinput
- __len__
- CSS
- __sub__
- MySQL
- fnmatch
- count()
- node.js
- shuffle()
- discard()
- View
- items()
- shutil
- glob
- JS
- zipfile
- decode()
- HTML
- choice()
- 오버라이딩
- 파이썬
- mro()
- inplace()
- locals()
- __getitem__
Archives
- Today
- Total
목록__call__ (1)
흰둥이는 코드를 짤 때 짖어 (왈!왈!왈!왈!왈!왈!왈!왈!왈!왈!왈!)

1. 클로저(Closure) 함수 안의 함수를 결과로 반환할 때, 그 내부 함수를 클로저라고 함 콜백함수, 함수의 순차적 실행, 데코레이터 함수에 사용 In [1]: def mul2(n): return n * 2 In [2]: mul2(10) Out[2]: 20 In [3]: mul2(5) Out[3]: 10 In [4]: def mul5(n): return n * 5 In [5]: mul5(10) Out[5]: 50 In [6]: mul5(5) Out[6]: 25 In [7]: # mul1, mul2, mul3 ... mul100도 만들어야 하나? class Mul: def __init__(self, m): self.m = m def mul(self, n): return self.m * n In [8]..
파이썬 기초
2023. 3. 13. 15:37