Advertisement
simeonshopov

Name game (july exam)

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