Skip to content

Commit d9f36c4

Browse files
committed
Combinatorics
1 parent 22b3590 commit d9f36c4

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -436,6 +436,14 @@ from itertools import combinations, combinations_with_replacement, permutations,
436436
```
437437

438438
```python
439+
>>> product([0, 1], repeat=3)
440+
[(0, 0, 0), (0, 0, 1), (0, 1, 0), (0, 1, 1),
441+
(1, 0, 0), (1, 0, 1), (1, 1, 0), (1, 1, 1)]
442+
443+
>>> product('ab', '12')
444+
[('a', '1'), ('a', '2'),
445+
('b', '1'), ('b', '2')]
446+
439447
>>> combinations('abc', 2)
440448
[('a', 'b'), ('a', 'c'), ('b', 'c')]
441449

@@ -448,14 +456,6 @@ from itertools import combinations, combinations_with_replacement, permutations,
448456
[('a', 'b'), ('a', 'c'),
449457
('b', 'a'), ('b', 'c'),
450458
('c', 'a'), ('c', 'b')]
451-
452-
>>> product('ab', '12')
453-
[('a', '1'), ('a', '2'),
454-
('b', '1'), ('b', '2')]
455-
456-
>>> product([0, 1], repeat=3)
457-
[(0, 0, 0), (0, 0, 1), (0, 1, 0), (0, 1, 1),
458-
(1, 0, 0), (1, 0, 1), (1, 1, 0), (1, 1, 1)]
459459
```
460460

461461

0 commit comments

Comments
 (0)