update readme.py

This commit is contained in:
Rohit Tanwar
2018-01-21 12:13:24 +05:30
parent 862327ceed
commit 3266885fc0
6 changed files with 145 additions and 104 deletions

View File

@ -1,5 +1,7 @@
### count_occurences
:information_source: Already implemented via `list.count()`.
Counts the occurrences of a value in an list.
Uses the `reduce` functin from built-in module `functools` to increment a counter each time you encounter the specific value inside the list.

View File

@ -1,5 +1,7 @@
### shuffle
:information_source: The same algorithm is already implemented via `random.shuffle`.
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.