Suggests using builtin functions for median, sample, shuffle, split_lines and zip

This commit is contained in:
Pablo Baeyens
2020-01-04 14:00:20 +01:00
parent 2ba974cd2d
commit ed8394afc8
5 changed files with 10 additions and 0 deletions

View File

@ -7,6 +7,8 @@ Splits a multiline string into a list of lines.
Use `s.split()` and `'\n'` to match line breaks and create a list.
[`str.splitlines`](https://docs.python.org/3/library/stdtypes.html#str.splitlines) provides similar functionality to this snippet.
```py
def split_lines(s):
return s.split('\n')