Hi all. I've hit a bit of a roadblock with this exercise. I am receiving the error "list index out of range" with the attached code. It seems one of my week spots is indexes, and I don't appear to fully understand their use. Any help is greatly appreciated.
def median(lst): s = sorted(lst) if len(lst) == 1: return lst elif len(s) % 2 != 0: j = (len(s) // 2) + 1 return lst[j] else: k = lst[len(s) / 2] h = lst[k + 1] return (k + h) / (2.0)