Hey guys i'm trying to find the median in a list of user inputs and i'm not quite sure where i am going wrong.
When I run the code I get thisCode:def median(alist): s_list = sorted(alist) l = len(alist) if l % 2: return s_list[1 // 2] else: return (s_list[1 // 2] + s_list[1 // 2 - 1]) / 2.0
Any help is much appreciated. Thanks.Code:median([7,12,3,1,6]) 1