Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- n = int(input())
- totalGrades = 0.0
- totalCredits = 0.0
- for i in range(n):
- number = int(input())
- grade = number % 10
- credit = int(number / 10)
- totalGrades += grade
- if grade == 2:
- credit = 0
- elif grade == 3:
- credit *= 0.50
- elif grade == 4:
- credit *= 0.70
- elif grade == 5:
- credit *= 0.85
- totalCredits += credit
- print(f"{totalCredits:.2f}\n{totalGrades / n:.2f}")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement