| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 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
- iterator
- attribute
- Protocol
- Substring with Concatenation of All Words
- 43. Multiply Strings
- DWG
- 30. Substring with Concatenation of All Words
- 컴퓨터의 구조
- Decorator
- kaggle
- t1
- concurrency
- 109. Convert Sorted List to Binary Search Tree
- Python Code
- 715. Range Module
- Class
- data science
- Regular Expression
- 밴픽
- 시바견
- Python Implementation
- 운영체제
- 파이썬
- LeetCode
- shiba
- Convert Sorted List to Binary Search Tree
- Generator
- 프로그래머스
- 315. Count of Smaller Numbers After Self
- Python
Archives
- Today
- Total
목록Closure (1)
Scribbling
Python: Decorator & Closure
Decorator is a callable that takes another function as its parameter. Decorator is executed during 'import time'. The key idea about closure you must understand is that it can access to 'nonlocal' variables outside the function. Take a look at the below exmaple. def make_averager(): series = [] def averager(new_val): series.append(new_val) return sum(series) / len(series) return averager avg = m..
Computer Science/Python
2022. 3. 29. 11:49