Advertisement
Guest User

Untitled

a guest
Aug 1st, 2020
586
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. import sys
  2.  
  3. name = input()
  4.  
  5. max_score = - sys.maxsize
  6. winner_name = ""
  7.  
  8. while name != "STOP":
  9. n = int(input())
  10. current_score = 0
  11.  
  12. for letter in name:
  13.  
  14. if n == ord(letter):
  15. current_score += 10
  16. else:
  17. current_score += 2
  18.  
  19. if current_score >= max_score:
  20. max_score = current_score
  21. winner_name = name
  22.  
  23. name = input()
  24.  
  25. print(f'The winner is {name} with {max_score} points!')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement