In the following codes for looking for median of a numerical list:

def median(list):

sorted_list = sorted(list)

if len(sorted_list) % 2 != 0:

index = len(sorted_list) // 2

return sorted_list[index]

elif len(sorted_list) % 2 == 0:

index_1 = len(sorted_list) / 2

index_2 = len(sorted_list) / 2 - 1

median = (sorted_list[index_1] + sorted_list[index_2]) / 2.0

return median

print median([2, 3, 4, 5, 6, 8, 7, 9])

Why is the " index_2 = len(sorted_list) / 2 - 1" not " index_2 = len(sorted_list) / 2 + 1 "?