Advertisement
Guest User

Untitled

a guest
May 29th, 2016
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. word = "funny" #the word value needs to be edited accordingly
  2. z=0
  3. l=[]
  4. for x in range(0, len(word)):
  5. l.append("_")
  6. while z != 5: #the "5" here determines the number of guesses
  7. G = input("Guess: ")
  8. for y in range(0, len(word)):
  9. if (G in word[y]) is True:
  10. l.pop(y)
  11. l.insert(y,G)
  12. if (G in word) is True:
  13. print("".join(l[0:len(word)]))
  14. print("Guesses left: ",6-z) #the "x-z" needs to be edited
  15. #accordingly with the number of guesses
  16. else:
  17. print("".join(l[0:len(word)]))
  18. z=z+1
  19. print("Guesses left: ",6-z) #the "x-z" needs to be edited
  20. #accordingly with the number of guesses
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement