Advertisement
Spocoman

Easter Competition

Feb 15th, 2022
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.53 KB | None | 0 0
  1. bakers_num = int(input())
  2. won_baker = ''
  3. max_point = 0
  4.  
  5. for i in range(bakers_num):
  6.     baker_name = input()
  7.     current_point = 0
  8.  
  9.     while True:
  10.         info = input()
  11.         if info == 'Stop':
  12.             break
  13.         current_point += int(info)
  14.  
  15.     print(f"{baker_name} has {current_point} points.")
  16.  
  17.     if current_point > max_point:
  18.         max_point = current_point
  19.         won_baker = baker_name
  20.         print(f"{baker_name} is the new number 1!")
  21.  
  22. print(f"{won_baker} won competition with {max_point} points!")
  23.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement