• what have I done wrong?

Question related to mission Median

 

I've tried this a few ways but keep getting an error I do not understand. I am not trying to use a float as a list index, but that is the error I keep getting. The code works fine in the python environment I have set up on my PC.