in the fifteenth paragraph of Practice Makes Perfect
i need to find medium value.
I was faced with the following error :Oops, try again. median([4, 5, 5, 4]) returned 5.0 instead of 4.5
length of List is 4, in this way function must return medium value for 5 and 5. and it's 5!
def median(L): med=0 if len(L)%2==0: med=(L[len(L)/2-1]+L[len(L)/2])/2.0 else: med = L[(len(L)-1)/2] return (med)