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 @@ Randomizes the order of the values of an list, returning a new list.
Uses the [Fisher-Yates algorithm](https://en.wikipedia.org/wiki/Fisher%E2%80%93Yates_shuffle) to reorder the elements of the list.
[`random.shuffle`](https://docs.python.org/3/library/random.html#random.shuffle) provides similar functionality to this snippet.
```py
from copy import deepcopy
from random import randint