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