Browse Source

Itertools

pull/3/head
Jure Šorn 6 years ago
parent
commit
56ff8020b3
1 changed files with 0 additions and 9 deletions
  1. 9
      README.md

9
README.md

@ -752,26 +752,17 @@ from itertools import *
### Math
#### Combinations
```python
>>> combinations('abc', 2)
[('a', 'b'), ('a', 'c'), ('b', 'c')]
```
#### Combinations with Replacement
```python
>>> ombinations_with_replacement('abc', 2)
[('a', 'a'), ('a', 'b'), ('a', 'c'), ('b', 'b'), ('b', 'c'), ('c', 'c')]
```
#### Permutations
```python
>>> permutations('abc', 2)
[('a', 'b'), ('a', 'c'), ('b', 'a'), ('b', 'c'), ('c', 'a'), ('c', 'b')]
```
#### Product
```python
>>> product('ab', [1, 2])
[('a', 1), ('a', 2), ('b', 1), ('b', 2)]
```

Loading…
Cancel
Save