[10, 20, 30, 40]
给定一个数字数组，写一个程序找到中位数。
"""
# 计算数组的中位数

def find_median(data):
    data.sort()
    n = len(data)

    if n % 2 == 0:  
        median = (data[n//2] + data[n//2-1])/2
    else: 
        median = data[n//2] 
    
    return median

if __name__ == "__main__":
    data = [10, 20, 30, 40]
    median = find_median(data)
    print("中位数是:", median)
"""