mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-07-05 17:34:49 +08:00
[mypy] Fix type annotations for maths (#4617)
* Fix mypy errors for armstrong_numbers.py * Fix mypy errors for harmonic_series.py * Fix mypy errors for average_median.py
This commit is contained in:
@ -1,14 +1,14 @@
|
||||
from typing import Union
|
||||
|
||||
|
||||
def median(nums: Union[int, float]) -> Union[int, float]:
|
||||
def median(nums: list) -> Union[int, float]:
|
||||
"""
|
||||
Find median of a list of numbers.
|
||||
Wiki: https://en.wikipedia.org/wiki/Median
|
||||
|
||||
>>> median([0])
|
||||
0
|
||||
>>> median([4,1,3,2])
|
||||
>>> median([4, 1, 3, 2])
|
||||
2.5
|
||||
>>> median([2, 70, 6, 50, 20, 8, 4])
|
||||
8
|
||||
|
Reference in New Issue
Block a user