Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- word = "funny" #the word value needs to be edited accordingly
- z=0
- l=[]
- for x in range(0, len(word)):
- l.append("_")
- while z != 5: #the "5" here determines the number of guesses
- G = input("Guess: ")
- for y in range(0, len(word)):
- if (G in word[y]) is True:
- l.pop(y)
- l.insert(y,G)
- if (G in word) is True:
- print("".join(l[0:len(word)]))
- print("Guesses left: ",6-z) #the "x-z" needs to be edited
- #accordingly with the number of guesses
- else:
- print("".join(l[0:len(word)]))
- z=z+1
- print("Guesses left: ",6-z) #the "x-z" needs to be edited
- #accordingly with the number of guesses
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement