'itertools' module Flashcards

1
Q

itertools.count(x)

A

count(10) –> 10 11 12 13 14 …

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

itertools.cycle(x)

A

cycle(‘ABCD’) –> A B C D A B C D …

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

itertools.repeat(x)

A

repeat(10, 3) –> 10 10 10

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

itertools.combinations(x)

A

returns possible orderings of input, in sorted order, no repeated elements (order matters and will not be repeated)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
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)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly