Kaloyankerr

Easter competition

Oct 31st, 2019
400
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. import sys
  2. n = int(input())
  3. best_chef = ''
  4. max_rating = -sys.maxsize
  5.  
  6. for i in range (1, n + 1):
  7. baker_name = input()
  8. rating = input()
  9. total_rating = 0
  10.  
  11. while rating != 'Stop':
  12. rating = int(rating)
  13. total_rating += rating
  14. rating = input()
  15.  
  16. print(f"{baker_name} has {total_rating} points.")
  17.  
  18. if total_rating > max_rating:
  19. best_chef = baker_name
  20. max_rating = total_rating
  21. print(f"{baker_name} is the new number 1!")
  22.  
  23. print(f"{best_chef} won competition with {max_rating} points!")
Advertisement
Add Comment
Please, Sign In to add comment