Advertisement
Guest User

Untitled

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