You are viewing a single comment's thread. Return to all comments →
I did this, but it fails the last hidden test. I cannot figure out why
import statistics N = int(input()) X = list(map(int, input().split())) mean = statistics.mean(X) median = statistics.median(X) def mode(sample): try: return statistics.mode(sample) except: return min(sample) mode = mode(X) print("{:.1f}".format(mean)) print("{:.1f}".format(median)) print(mode)
print("{:.1f}".format(mean)) print("{:.1f}".format(median)) print(mode)
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 →
I did this, but it fails the last hidden test. I cannot figure out why
print("{:.1f}".format(mean)) print("{:.1f}".format(median)) print(mode)