Advertisement
aneliabogeva

Best player

May 17th, 2019
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. command = input()
  2. hettrick_made = 0
  3. the_best_player = ''
  4. goals_best_player = 0
  5.  
  6. while command != "END":
  7. name = command
  8. goals = int(input())
  9. if goals > goals_best_player:
  10. goals_best_player = goals
  11. the_best_player = name
  12. if goals >= 3 and goals < 10:
  13. hettrick_made += 1
  14. elif goals >= 10:
  15. goals_best_player = goals
  16. the_best_player = name
  17. break
  18. command = input()
  19. print(f"{the_best_player} is the best player!")
  20. if hettrick_made > 0:
  21. print(f"He has scored {goals_best_player} goals and made a hat-trick !!!")
  22. elif goals_best_player >= 10:
  23. print(f"He has scored {goals_best_player} goals and made a hat-trick !!!")
  24. else:
  25. print(f"He has scored {goals_best_player} goals.")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement