diff --git a/README.md b/README.md index c81493e..bcce530 100644 --- a/README.md +++ b/README.md @@ -140,6 +140,8 @@ for line in iter(partial(input, 'Please enter value'), ''): Generator --------- +**Convenient way to implement the iterator protocol.** + ```python def step(start, step): while True: @@ -171,8 +173,8 @@ String = .strip([chars]) = .join() = .startswith() # Pass tuple of strings for multiple options. - = .endswith() # Pass tuple of strings for multiple options. - = .isnumeric() # True if str contains only numeric characters. + = .endswith() # Pass tuple of strings for multiple options. + = .isnumeric() # True if str contains only numeric characters. ``` ### Print @@ -185,8 +187,8 @@ print( [, , end='', sep='', file=]) # Use 'file=sys.stderr' for e ```python import re re.sub(, new, text, count=0) # Substitutes all occurrences. -re.search(, text) # Searches for first occurrence of pattern. -re.match(, text) # Searches only at the beginning of the string. +re.search(, text) # Searches for first occurrence of pattern. +re.match(, text) # Searches only at the beginning of the string. re.findall(, text) re.split(, text, maxsplit=0) # Use brackets in regex to keep the matches. ``` @@ -255,7 +257,7 @@ Numbers ```python round([, ndigits]) abs() -math.pow(x, y) # == x**y +math.pow(x, y) # == x**y ``` ### Constants