1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | def func(): for i in range(10): yield i return 'exit' for i in func(): print(i) ''' output 0 1 2 ... 9 ''' | cs |
마지막 return문의 'exit'는 출력되지 않는다
'Language > python' 카테고리의 다른 글
[python] BeautifulSoup4 vs Scrapy (0) | 2018.05.01 |
---|---|
[python] map object (0) | 2018.04.26 |
[python] elasticsearch-dsl scan / index / doc_type (0) | 2018.04.12 |
[python] logging handler class 소개 (0) | 2018.04.12 |
[python] logging process/order/cycle/how-to-work (0) | 2018.04.11 |
WRITTEN BY
- hojongs
블로그 옮겼습니다 https://hojongs.github.io/