Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- name_of_student = input()
- sum_grades = 0.0
- average_grade = 0.0
- excluded = 0
- class_of_student = 1
- while class_of_student <= 12:
- grade = float(input())
- if grade >= 4:
- class_of_student += 1
- sum_grades += grade
- else:
- excluded += 1
- if excluded > 1:
- print(f'{name_of_student} has been excluded at {class_of_student} grade ')
- break
- if excluded < 2:
- average_grade = sum_grades / 12
- print(f'{name_of_student} graduated. Average grade: {average_grade:.2f}')
Advertisement
Add Comment
Please, Sign In to add comment