So when I paste this code into my Python 3.6 on my computer it tells me that:
median([4, 5, 5, 4]) = 4.5
Yet when I try this code in the exercise screen it throws up the error:
"Oops, try again. median([4, 5, 5, 4]) returned 4.0 instead of 4.5
def median(x): y = sorted(x) B2 = int((len(y)/2)) if len(y)%2 == 0: B1 = int((len(y)/2)-1) return float((y[B1]+y[B2])/2) else: return y[int(B2)]
Any help is greatly appreciated. Could this be a problem with codeacademy using a different version of Python?