Suggests using builtin functions for median, sample, shuffle, split_lines and zip
This commit is contained in:
@ -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')
|
||||
|
||||
Reference in New Issue
Block a user