Advertisement
bl00dt3ars

06. Name Game (2)

Nov 20th, 2020
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.49 KB | None | 0 0
  1. winner = ""
  2. winner_points = 0
  3.  
  4. player = input()
  5.  
  6. while player != "Stop":
  7.  
  8.     current_points = 0
  9.  
  10.     for i in range(len(player)):
  11.         num = int(input())
  12.         if ord(player[i]) == num:
  13.             current_points += 10
  14.         else:
  15.             current_points += 2
  16.            
  17.     if current_points >= winner_points:
  18.         winner_points = current_points
  19.         winner = player
  20.        
  21.     player = input()
  22.    
  23. print(f"The winner is {winner} with {winner_points} points!")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement