So it seems to me from looking at these answers that I'm probably trying to over-simplify it. But I'd like to understand why what I have produced doesn't work?

def median(incoming):
    return ( sum(incoming) / len(incoming) )

I'd appreciate your help,


Practice Makes Perfect - Median

lets say the list is:


the median value is 3, your approach would result in: 110/5, which is 22. Its about getting the middle values, not calculating an average


Oh Yes, Duh.. I'm calculating the Mean. Thanks, and sorry for wasting your time.


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.