Stuck on card games

def approx_average_is_average(hand):
middle_index = float(len(hand))/2
median = hand[middle_index]
middle_array = (hand[0] + hand[-1])/len(hand)
return middle_array == median

Hello I am stuck on this exercise here. I am not getting the median correctly .

What happens when you run the tests? Is there an error? Could you share all details? (Please use codeblocks. Please do not use screenshots.)