diff --git a/README.md b/README.md index 3146c2a..11b4bac 100644 --- a/README.md +++ b/README.md @@ -168,13 +168,6 @@ Iterator = iter(, to_exclusive) ``` -#### Skips first element: -```python -next(, None) # default of `None` avoids exception for empty -for element in : - ... -``` - #### Reads input until it reaches an empty line: ```python for line in iter(input, ''): @@ -188,6 +181,17 @@ for line in iter(partial(input, 'Please enter value: '), ''): ... ``` +### Next +**Returns next item. If there are no more items it raises exception or returns default if specified.** + = next( [, default]) + +#### Skips first item: +```python +next(, None) +for element in : + ... +``` + Generator ---------