0
우리는 평균 점수를 계산해야합니다. 입력은 다음과 같이 될 것이다 :python3의 round() 내장 함수가 왜 작동하지 않습니까? 주어진 학생에 대해
3
크리 67 68 69
에게 아르 준 70 98 63
리카 52 56 60
리카
번호 :
을if __name__ == '__main__':
n = int(input()) # takes input
student_marks = {}
for _ in range(n):
name, *line = input().split()
scores = list(map(float, line))
student_marks[name] = scores
query_name = input()
a,b,c=student_marks[query_name]
avg=(a+b+c)/3 #avg is calculated.
output =round(avg,2) ## why can't I use print(round(avg,2)) to give 56.00 but it is giving 56.0 only
print("%.2f" % output) # for my output in two decimal places I had to use this
여기 나는 round (avg, 2)가 56.00을주지 못한 이유를 알고 싶습니까? –