
A serious bug was addressed with this pull request. The mode function previously didn't return the mode of the input list. Instead, it always returned the first value. Due to lacking tests, the bug was never caught. This pull request also adds new functionality to the function, allowing support for more than one mode. See #4464 for details. * * Mistake in average_mode.py fixed. The previous solution was to returnthe value on the first loop iteration, which is not correct, more than that it used to delete repeating values, so result's array and check array lost relation between each other * Type hint added * redundant check_list deleted Co-authored-by: Maxim R. <49735721+mrmaxguns@users.noreply.github.com> * Suggestions resolved * output typing changed to Any * test cases added * Black done File formatted * Unused statistics import statistics only used in doctest, now they are imported in doctest * Several modes support added Several modes support added * Comment fix * Update maths/average_mode.py Co-authored-by: Maxim R. <49735721+mrmaxguns@users.noreply.github.com> * Suggestions added Co-authored-by: Maxim R. <49735721+mrmaxguns@users.noreply.github.com>
[mypy] Fix type annotations for linked_stack.py, evaluate_postfix_notations.py, stack.py in data structures (#4409)
The Algorithms - Python
All algorithms implemented in Python (for education)
These implementations are for learning purposes only. Therefore they may be less efficient than the implementations in the Python standard library.
Contribution Guidelines
Read our Contribution Guidelines before you contribute.
Community Channel
We're on Gitter! Please join us.
List of Algorithms
See our directory.
Description
Languages
Python
99.9%
Shell
0.1%