iterables and iterations Flashcards
1
Q
map
A
map(f, a, b,c )
2
Q
get count object
A
itertools.count()
3
Q
import reduce
A
from functools import reduce
4
Q
reduce example
A
reduce(operator.add, values, 0)
5
Q
iterator protocol
A
__iter__(), __next__(), StopIteration
6
Q
alternative iterable protocol
A
__getitem__()
7
Q
iter
A
iter(callable, sentinel)