def median(lst):
    """
    Returns median of the lst.
    """
    sorted_list = sorted(lst)
    list_len = len(sorted_list)
    index = (list_len - 1) // 2
    if list_len % 2:
        return sorted_list[index]
    else:
        return (sorted_list[index] + sorted_list[index + 1])/2.0