Advertisement
exDotaPro

20_april_2019_6_easter_competition

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