Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- students = int(input())
- grade3 = 0
- grade4 = 0
- grade5 = 0
- grade6 = 0
- gradeSum = 0
- for i in range(students):
- grade = float(input())
- if grade >= 5:
- grade6 += 1
- elif grade >= 4:
- grade5 += 1
- elif grade >= 3:
- grade4 += 1
- elif grade >= 2:
- grade3 += 1
- gradeSum += grade
- print(f'Top students: {(grade6 / students * 100):.2f}%')
- print(f'Between 4.00 and 4.99: {(grade5 / students * 100):.2f}%')
- print(f'Between 3.00 and 3.99: {(grade4 / students * 100):.2f}%')
- print(f'Fail: {(grade3 / students * 100):.2f}%')
- print(f'Average: {(gradeSum / students):.2f}')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement