Replace this line with your code.


def median(numbers) :

if len(x)%2==0 and len(x)!=1 :

    j= x[(len(x)/2) -1]

    return (j+k)/2.0

if len(x)%2!=0 and len(x)!=1 :
    total=x[(len(x)/2) -0.5]
    return total
if len(x)==1 :
    return x[0]

return sorted_numbers[-1]


FOr some reason this says list indices must be integers not float even though i am never passing in a float as an index


This is a float, even if it equates to whole number... 3.0


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