Browse Source

Iterator

pull/27/head
Jure Šorn 5 years ago
parent
commit
22b3590082
1 changed files with 0 additions and 21 deletions
  1. 21
      README.md

21
README.md

@ -199,27 +199,6 @@ from itertools import islice, count, repeat, cycle, chain
<iter> = islice(<collection>, from_inclusive, to_exclusive, step_size)
```
### Examples
#### Reads input until it reaches an empty line:
```python
for line in iter(input, ''):
...
```
#### Same, but prints a message every time:
```python
from functools import partial
for line in iter(partial(input, 'Please enter value: '), ''):
...
```
#### Skips first item:
```python
next(<iter>)
for element in <iter>:
...
```
Generator
---------

Loading…
Cancel
Save