Advertisement
Nikola_Stankov

Best Player

Oct 23rd, 2022
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.58 KB | None | 0 0
  1. import sys
  2.  
  3. goals = 0
  4. max_gols = -sys.maxsize
  5. best_player_name = ''
  6. flag = False
  7.  
  8. while True:
  9.     name = input()
  10.  
  11.     if name == 'END':
  12.         flag = True
  13.         break
  14.     goals = int(input())
  15.     if goals >= 10:
  16.         best_player_name = name
  17.         flag = True
  18.         break
  19.  
  20.     if goals > max_gols:
  21.         max_gols = goals
  22.         best_player_name = name
  23.  
  24. if flag:
  25.     print(f'{best_player_name} is the best player!')
  26.  
  27. if goals >= 3:
  28.     print(f'He has scored {goals} goals and made a hat-trick !!!')
  29. else:
  30.     print(f'He has scored {goals} goals.')
  31.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement