본문 바로가기

알고리즘/Python

[Python | SWEA] 2071. 평균값 구하기

https://swexpertacademy.com/main/code/problem/problemDetail.do?problemLevel=1&contestProbId=AV5QRnJqA5cDFAUq&categoryId=AV5QRnJqA5cDFAUq&categoryType=CODE&problemTitle=&orderBy=RECOMMEND_COUNT&selectCodeLang=PYTHON&select-1=1&pageSize=10&pageIndex=1 

 

SW Expert Academy

SW 프로그래밍 역량 강화에 도움이 되는 다양한 학습 컨텐츠를 확인하세요!

swexpertacademy.com

 

문제

10개의 수를 입력 받아, 평균값을 출력하는 프로그램을 작성하라.

 

제출 답안

T = int(input())
for test_case in range(1, T + 1):
    total = sum(map(int, input().split()))
    print(f"#{test_case} {round(total/10)}")