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