'itertools' module Flashcards
1
Q
itertools.count(x)
A
count(10) –> 10 11 12 13 14 …
2
Q
itertools.cycle(x)
A
cycle(‘ABCD’) –> A B C D A B C D …
3
Q
itertools.repeat(x)
A
repeat(10, 3) –> 10 10 10
4
Q
itertools.combinations(x)
A
returns possible orderings of input, in sorted order, no repeated elements (order matters and will not be repeated)
5
Q
itertools.permutations(x)
A
returns all possible orderings of input, no repeated elements (order does not matter and will be repeated in different orders)