def median(raw):

new=sorted(raw)

if len(new)%2==1:

return new[int(len(new)/2+0.5)]

else:

return 0.5*new[len(new)/2]+0.5*new[len(new)/2-1]

So this is my code, the bit im not sure about is the 4th line, where i've written "+0.5", i swear it should be "-0.5"?

In a list of 5 numbers you want the third, i.e the one at index 2? So len(new)/2-0.5 will give 5/2-0.5 which equals 2...

Codeacademy is accepting the +0.5 which implies index 3 but not the -0.5 version which implies index 2.

Not sure what's wrong here unless my understanding of len() is wrong?