PYTHON 49

[B2108][통계학][python]

import sys from collections import Counter n = int(sys.stdin.readline()) arr = [int(sys.stdin.readline()) for _ in range(n)] def mean(num): return round(sum(num)/len(num)) def median(num): num.sort() return num[len(num)//2] def mode(num): mode_dict = Counter(num) # 딕셔너리로 데이터 등장 횟수 저장 m = mode_dict.most_common() # 등장한 횟수를 내림차순으로 정리 if len(num) > 1: if m[0][1] == m[1][1]: mod = m[1][0] else: mod =..

BAEKJOON/Python 2021.03.19