Sichanov

easter competition

Apr 23rd, 2021
154
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.61 KB | None | 0 0
  1. number_of_easter_breads = int(input())
  2. best_score = 0
  3. current_score = 0
  4. best_chef = ''
  5. for each_easter_bread in range(number_of_easter_breads):
  6.  
  7.     bread_maker = input()
  8.     command = input()
  9.     current_score = 0
  10.     while command != 'Stop':
  11.         score = int(command)
  12.         current_score += score
  13.         command = input()
  14.  
  15.     print(f'{bread_maker} has {current_score} points.')
  16.     if current_score > best_score:
  17.         best_score = current_score
  18.         best_chef = bread_maker
  19.         print(f'{bread_maker} is the new number 1!')
  20. print(f'{best_chef} won competition with {best_score} points!')
Advertisement
Add Comment
Please, Sign In to add comment