|
|
@ -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 |
|
|
|