Advertisement
Guest User

Untitled

a guest
Feb 18th, 2020
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.47 KB | None | 0 0
  1. print("What's the capital of Russia?")
  2.  
  3. answer_up = "Moscow"
  4. answer = answer_up.lower()
  5.  
  6. word = ["#" for letter in answer]
  7.  
  8. while "#" in word:
  9.  
  10.     print(*word)
  11.     letter = input("Your letter: ").lower()
  12.  
  13.     if letter in answer:
  14.         print('Right!')
  15.         for i in range(len(answer)):
  16.             if letter == answer[i]:
  17.                 word[i] = answer_up[i]
  18.     else:
  19.         print('Wrong! Try again!')
  20.  
  21. print("You win!")
  22. print("The word is:", answer_up)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement