I got correct result on my local IDE but was told wrong on the platform.
My code is returning 4.5 not 4, but the platform keeps telling me that the result is 4.
Can anyone help me to check this inconsistency? Thank you very much!
def median(List): mylist = sorted(List) if len(List) == 1: return List elif len(List)%2 == 0: return mylist[int(len(mylist)/2-1)]/2 + mylist[int(len(mylist)/2)]/2 else: return mylist[len(List)/2-0.5]