Error: (with  supplied)
Oops, try again.
median() resulted in an error: 'list' object has no attribute 'len'
I need help here obviously. It keeps erroring out. With median[126.96.36.199], it kept returning 4 instead of 4.5. And with median, I keep getting the one I mentioned above: median() resulted in an error: 'list' object has no attribute 'len'
def median(x): new_lst = x s = new_lst.sort() #sortiing list leng = new_lst.len(s) #getting length #Below: was getting an error when the list was just a  so made the 'if' and 'elif' to check if length is greater than 1 and then the other half of the argument. if leng > 1 and leng % 2 != 0: med = (leng / 2.0) return med elif leng > 1 and leng % 2 == 0: a = (leng / 2.0) b = a - 1 c = s.index[a] d = s.index[b] med = s[c] + s[d] / 2.0 return med else: return s
Thanks in advance for your help!!!