Hello friends, I'm creating a program in Python and it gives me that error. Here is my code to know if you can help me, thank you very much
def calculoMediana(list):
mediana = float(0)
tamaño = len(list)
if tamaño %2 ==0:
mediana = (list[(tamaño // 2)] + list[(tamaño //2)-1])/2
return mediana
else:
mediana = list[(tamaño//2)]
return mediana
def lista():
continuar = "SI"
while continuar.upper() == "SI":
n = int(input("Ingrese el tamaño del que desea su lista:"))
cantidad = 0
list = []
while cantidad<n:
valor = int(input("Favor ingrese un valor de la lista:"))
cantidad = cantidad + 1
list.append(valor)
list.sort()
print (calculoMediana(list))
continuar = input("Desea continuar (SI/NO)?")
try:
lista()
except ValueError:
print("Favor ingrese un numero entero")
pass
lista()
my mistake says
valueerror invalid literal for int () with base 10: 'm'
and then I do not care, but
valueerror invalid literal for int () with base 10: 'p'
Thanks for your help