티스토리 뷰
>>> import random
>>> it = iter(lambda : random.randint(0, 5), 2)
>>> next(it)
0
>>> next(it)
3
>>> next(it)
1
>>> next(it)
Traceback (most recent call last):
File "<pyshell#37>", line 1, in <module>
next(it)
StopIteration
'PL > Python' 카테고리의 다른 글
[Python] bin, hex 변환 (0) | 2021.11.12 |
---|---|
[Python] bound/unbound 차이 (0) | 2021.11.07 |
[Python] sort key값 (0) | 2021.08.12 |
[Python][numpy] colon, comma in array (0) | 2021.08.11 |
[Python] for문에서 array(list)의 데이터 변형 (0) | 2021.08.05 |