Advertisement
Sichanov

best_player

Feb 12th, 2022
1,295
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.47 KB | None | 0 0
  1. player = input()
  2.  
  3. best_player = ''
  4. max_goals = float("-inf")
  5.  
  6. while True:
  7.     if player == 'END':
  8.         break
  9.     goals = int(input())
  10.     if goals > max_goals:
  11.         max_goals = goals
  12.         best_player = player
  13.     if goals >= 10:
  14.         break
  15.     player = input()
  16.  
  17. print(f'{best_player} is the best player!')
  18. if max_goals >= 3:
  19.     print(f'He has scored {max_goals} goals and made a hat-trick !!!')
  20. else:
  21.     print(f'He has scored {max_goals} goals.')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement