Advertisement
anton_d

08.graduation

Jan 13th, 2022 (edited)
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.38 KB | None | 0 0
  1. name = input()
  2. grades = 0
  3. clas = 0
  4. average_grades = 0
  5.  
  6. while True:
  7.     score = float(input())
  8.     grades += score
  9.     clas += 1
  10.     if score <= 2:
  11.         print(f'{name} has been excluded at {clas} grade')
  12.         break
  13.     elif grades > 4.00 and clas == 12:
  14.         average_grades = grades / clas
  15.         print(f'{name} graduated. Average grade: {average_grades:.2f}')
  16.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement