Guest User

Untitled

a guest
Aug 20th, 2020
699
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.59 KB | None | 0 0
  1. easter_bread = int(input())
  2.  
  3. top_score = 0
  4. best_chef = ''
  5.  
  6. for _ in range(easter_bread):
  7.     new_best_baker = False
  8.     score = 0
  9.     name = input()
  10.  
  11.     while True:
  12.         command = input()
  13.  
  14.         if command == 'Stop':
  15.             break
  16.  
  17.         score += int(command)
  18.         if score > top_score:
  19.             top_score = score
  20.             best_chef = name
  21.             new_best_baker = True
  22.  
  23.     print(f'{name} has {score} points.')
  24.     if new_best_baker:
  25.         print(f'{best_chef} is the new number 1!')
  26.  
  27. print(f'{best_chef} won competition with {top_score} points!')
  28.  
Advertisement
Add Comment
Please, Sign In to add comment