Sichanov

easter competition

May 21st, 2021
165
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.62 KB | None | 0 0
  1. number_of_kozunacs = int(input())
  2. max_points = 0
  3. baker_with_max_points = ''
  4. for each_kozunac in range(number_of_kozunacs): # 1
  5.     name_of_baker = input()
  6.     command = input()
  7.     total_score = 0
  8.     while command != 'Stop':
  9.         score = int(command)
  10.         total_score += score
  11.         command = input()
  12.     print(f"{name_of_baker} has {total_score} points.")
  13.     if total_score > max_points:
  14.         max_points = total_score
  15.         baker_with_max_points = name_of_baker
  16.         print(f"{baker_with_max_points} is the new number 1!")
  17. print(f"{baker_with_max_points} won competition with {max_points} points!")
Advertisement
Add Comment
Please, Sign In to add comment