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