welcomeString = eval(input(
    """Welcome to MMMR Calculator
What would you like to calculate(Mean,Median,Mode,Range):"""
    ))
welcomeString = welcomeString.lower()
numbers = eval(input('What numbers would you like to use?:'))
numbers = list(map(float, numbers.split(',')))
average_function = {'mean': np.average, 'median': np.median, 'mode': np.
    mode, 'range': np.arange}
try:
    print(average_function[welcomeString](numbers))
except KeyError:
    sys.exit('You entered an invalid average type!')
eval(input())
Использование Numpy для поиска среднего, медианного, режима или диапазона введенного набора чисел