Sichanov

ss

Feb 7th, 2021
147
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.60 KB | None | 0 0
  1. fails = int(input())
  2. counter = 0
  3. fail_counter = 0
  4. grade = 0
  5. name = ""
  6. last_name = ''
  7. while name != "Enough":
  8.     name = input()
  9.     if name == 'Enough':
  10.         total_score = grade / counter
  11.         print(f"Average score: {total_score:.2f}")
  12.         print(f"Number of problems: {counter}")
  13.         print(f"Last problem: {last_name}")
  14.         break
  15.     score = int(input())
  16.     if score <= 4:
  17.         fail_counter += 1
  18.         if fail_counter == fails:
  19.             print(f"You need a break, {fail_counter} poor grades.")
  20.             break
  21.     counter += 1
  22.     grade += score
  23.     last_name = name
  24.  
Advertisement
Add Comment
Please, Sign In to add comment