You are viewing a single comment's thread. Return to all comments →
There's also this way using the statistics lib in Python.
from statistics import mean, median, multimode def mean_median_mode(arr): print(f"{mean(arr):.1f}", f"{median(arr):.1f}", min(multimode(arr)), sep='\n') if __name__ == '__main__': n = int(input()) arr = list(map(int, input().split(" "))) mean_median_mode(arr)
Seems like cookies are disabled on this browser, please enable them to open this website
Day 0: Mean, Median, and Mode
You are viewing a single comment's thread. Return to all comments →
There's also this way using the statistics lib in Python.