Advertisement
Onesible

Name Game

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