5, 15, 20, 2, 10
创建一个Python程序，计算一组数字的中位数.
def median_calc(nums): 
    nums.sort() 
    mid = len(nums)//2 
  
    if len(nums) % 2 == 0: 
        median = (nums[mid] + nums[mid - 1])/2 
    else: 
        median = nums[mid] 
  
    return median 
  
array = [5, 15, 20, 2, 10] 
n = len(array) 
  
med = median_calc(array) 
  
print("给定数组的中位数是：" + str(med))