Guest User

Untitled

a guest
Aug 1st, 2020
26
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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!')
RAW Paste Data