I really cannot see what's wrong with my code. Please explain if you do.
m_index = (len(sort/2) - 0.5
I assume that you subtract 0.5 to get to the next lower integer. But in Python 2 integer division will always return an integer.
print (3 / 2) # this will print 1
So you can just use
len(sort)/2 or you can use
len(sort) / 2.0 to get the result as a float and than substract 0.5.
OH! That would make a big difference. THANKS, and WOW what a generally useful fact!
I just saw that you also have
median = added/2, the same principle applies here.