Advertisement
eNeRGy90

Untitled

Nov 10th, 2018
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.40 KB | None | 0 0
  1. name = input()
  2.  
  3. year = 1
  4. fail_count = 0
  5. total_grade = 0
  6.  
  7. while year <= 12:
  8.     grade = float(input())
  9.     if grade < 4:
  10.         fail_count += 1
  11.         if fail_count == 2:
  12.             break
  13.  
  14.     else:
  15.         total_grade += grade
  16.         year += 1
  17.  
  18.  
  19. if year >= 12:
  20.     print(f"{name} graduated. Average grade: {total_grade/12:.2f}")
  21. else:
  22.     print(f"{name} has been excluded at {year} grade")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement