Sichanov

best_player

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