![[백준 알고리즘] 2108번 통계학 (Python)](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdna%2FbAPQ6j%2FbtqDOktCX4x%2FAAAAAAAAAAAAAAAAAAAAAHKNawA4axMljqGTfh5Yq_pThADoF5DAn2wR8-FJbnZW%2Fimg.png%3Fcredential%3DyqXZFxpELC7KVnFOS48ylbz2pIh7yKj8%26expires%3D1753973999%26allow_ip%3D%26allow_referer%3D%26signature%3DNc53xRllW0%252FZDDY12HKRRM2DPXs%253D)
언어, 알고리즘 공부/백준2020. 4. 29. 17:46[백준 알고리즘] 2108번 통계학 (Python)
import sys from collections import Counter n = int(sys.stdin.readline()) num_list = [] for _ in range(n): num_list.append(int(sys.stdin.readline())) num_list.sort() print(round(sum(num_list) / n)) # 산술평균 print(num_list[len(num_list) // 2]) # 중앙값 if len(num_list)>1: c = Counter(num_list).most_common(2) # 빈도수 print(c[1][0] if c[0][1] == c[1][1] else c[0][0]) else: print(num_list[0]) print(num_list..