Blue Bridge Cup Python Group - Score Analysis

Blue Bridge Cup Python Group - Score Analysis

Topic description

Xiaolan organized an exam for the students, with a total score of 100 points, and each student's score was an integer from 0 to 100.
Please calculate the highest, lowest and average scores for this exam.

enter description

The first line of input contains an integer n\ (1 ≤ n ≤ 10^4)n (1≤n≤10
4 ), which represents the number of people to test. The next nn lines, each containing an integer from 0 to 100, represent a student's score.

output description

Output three lines.
The first line contains an integer representing the highest score.
The second line contains an integer representing the lowest score.
The third line contains a real number, rounded to exactly two decimal places, representing the average score.

insert image description here

import os
import sys
n = int(input())
sore = []
for i in range(n):
    a = int(input())
    sore.append(a)
print(max(sore))
print(min(sore))
print('{:.2f}'.format(sum(sore)/n))

Thank you for your support. Your one-click three-connection is the biggest driving force for Ganggang students!

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324322241&siteId=291194637