Write a function to return the mean of numbers in a list


Topic: Write a function to return the mean of numbers in a list

Solution

def cal_mean(num_list:list)->float:
    if num_list:
        return sum(num_list)/len(num_list)
    else:
        return None



List all Python Programs