Browse Source

Iterator

pull/27/head
Jure Šorn 5 years ago
parent
commit
06488408b9
1 changed files with 6 additions and 6 deletions
  1. 12
      README.md

12
README.md

@ -182,12 +182,6 @@ from itertools import islice, count, repeat, cycle, chain
<el> = next(<iter> [, default]) # Raises StopIteration or returns 'default' on end.
```
```python
<iter> = islice(<collection>, to_exclusive)
<iter> = islice(<collection>, from_inclusive, to_exclusive)
<iter> = islice(<collection>, from_inclusive, to_exclusive, step_size)
```
```python
<iter> = count(start=0, step=1) # Returns incremented integer endlessly.
<iter> = repeat(<el> [, times]) # Returns element endlessly or 'times' times.
@ -199,6 +193,12 @@ from itertools import islice, count, repeat, cycle, chain
<iter> = chain.from_iterable(<collection>) # Empties collections inside a collection in order.
```
```python
<iter> = islice(<collection>, to_exclusive)
<iter> = islice(<collection>, from_inclusive, to_exclusive)
<iter> = islice(<collection>, from_inclusive, to_exclusive, step_size)
```
### Examples
#### Reads input until it reaches an empty line:
```python

Loading…
Cancel
Save