Last active
August 6, 2020 15:53
-
-
Save fuwiak/460d9fc3384b3eff1df6b4f18e930a81 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def mediana(lista): | |
N = len(lista) | |
lista.sort() | |
ind=N//2 | |
if N%2==1: | |
return lista[ind] | |
else: | |
return (lista[ind-1]+lista[ind])/2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment