yordan_yordanov

06. Easter Decoration

Aug 20th, 2020
266
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.64 KB | None | 0 0
  1. easter_bread = int(input())
  2.  
  3. score = None
  4. top_chef = None
  5. max_score = 0
  6.  
  7. for i in range(1, easter_bread + 1):
  8.     name = input()
  9.     score = int(input())
  10.     score_sum = 0
  11.  
  12.     while score != 'Stop':
  13.         score_num = int(score)
  14.  
  15.         if score_num <= 0 or score_num > 10:
  16.             score = input()
  17.             continue
  18.  
  19.         score_sum += score_num
  20.         score = input()
  21.  
  22.     print(f'{name} has {score_sum} points.')
  23.  
  24.     if score_sum > max_score:
  25.         max_score = score_sum
  26.         top_chef = name
  27.         print(f'{name} is the new number 1!')
  28.  
  29. print(f'{top_chef} won competition with {max_score} points!"')
  30.  
Advertisement
Add Comment
Please, Sign In to add comment