Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- failed_treshhold = int(input())
- failed_times = 0
- solved_problems_count = 0
- total_grades = 0
- last_problem = ''
- has_failed = True
- while failed_times < failed_treshhold:
- problem_name = input()
- if problem_name == 'Enough':
- has_failed = False
- break
- grade = int(input())
- if grade <= 4:
- failed_times += 1
- total_grades += grade
- solved_problems_count += 1
- last_problem = problem_name
- if has_failed:
- print(f'You need a break, {failed_treshhold} poor grades.')
- else:
- print(f'Average score: {total_grades / solved_problems_count:.2f}')
- print(f'Number of problems: {solved_problems_count}')
- print(f'Last problem: {last_problem}')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement