Advertisement
exDotaPro

2019_6_july_6_name_game

Feb 1st, 2020
176
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.57 KB | None | 0 0
  1. command = input()
  2.  
  3. points = 0
  4. most_points = 0
  5. winner = ''
  6.  
  7. while command != 'Stop':
  8.     player_name = command
  9.     points = 0
  10.  
  11.     for index in range(len(player_name)):
  12.         number = int(input())
  13.         letter = ord(player_name[index])
  14.  
  15.         if letter == number:
  16.             points += 10
  17.         else:
  18.             points += 2
  19.  
  20.         if points >= most_points:
  21.             most_points = points
  22.             winner = player_name
  23.  
  24.     command = input()
  25.  
  26.     if command == 'Stop':
  27.         print(f'The winner is {winner} with {most_points} points!')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement