Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- check_count = 12
- x = 0
- list_grade = []
- list_low_grade = []
- aver_list_low_grade = 0.0
- a = True
- y = 0.0
- name = input()
- while check_count != 0:
- grade = float(input())
- if list_low_grade: # Лошия списък не е празен
- list_grade.pop()
- list_grade.append(grade)
- if grade < 4:
- a = False
- break
- else:
- list_low_grade = []
- list_grade.append(grade)
- if grade < 4:
- list_low_grade.append(grade)
- else:
- check_count -= 1
- sum_list_grade = sum(list_grade)
- len_list_grade = len(list_grade)
- average_grade = sum_list_grade / len_list_grade
- if a:
- print(f"{name} graduated. Average grade: {average_grade:.2f}")
- else:
- print(f"{name} has been excluded at {len_list_grade} grade")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement