Mar-30-2020, 12:29 AM
(This post was last modified: Mar-30-2020, 12:29 AM by jackthechampion.)
So I have a guess the word game assignment need someone to help me fix it so the asteriks are synced with each word I did it before and just made the the words all the same length and got marked down, and then I need to make it to the word is being uncovered in the asterisks each time I guess a letter correctly I'm having issues figuring that out heres what I have so far
ie.
ie.
# Jack Crespin
#3/8/2020
#guess the word
import random
name = input("What is your name? ")
print("Good Luck ! ", name)
print ("Guess the word")
print("******")
words = ['accept', 'acting', 'advice', 'beauty',
'python', 'before', 'player', 'beyond',
'artist', 'branch', 'boards', 'branch']
word = random.choice(words)
print("Guess the characters")
guesses = ''
turns = 9000
while turns > 0:
failed = 0
for char in word:
if char in guesses:
print(char)
else:
print("_")
failed += 1
if failed == 0:
print("You Win")
print("The word is: ", word)
break
guess = input("guess a character:")
guesses += guess
if guess not in word:
turns -= 1
print("Wrong")
print("You have", + turns, 'more guesses')
if turns == 0:
print("You Loose")
input ("press enter to continue")
