Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Guess the word game help
#1
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.
# 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")
Reply


Messages In This Thread
Guess the word game help - by jackthechampion - Mar-30-2020, 12:29 AM
RE: Guess the word game help - by deanhystad - Mar-30-2020, 01:01 AM
RE: Guess the word game help - by annajenny - Sep-06-2023, 01:04 AM
RE: Guess the word game help - by Pedroski55 - Sep-06-2023, 06:51 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Ask again if wrong guess with While. EduPy 4 2,262 Oct-21-2021, 07:46 PM
Last Post: menator01
Question Problem: Check if a list contains a word and then continue with the next word Mangono 2 2,517 Aug-12-2021, 04:25 PM
Last Post: palladium
  I guess it's about print tsavoSG 2 2,120 Feb-08-2021, 08:34 PM
Last Post: steve_shambles
  Word Game paulmerton4pope 4 2,440 Jul-11-2020, 02:50 PM
Last Post: paulmerton4pope
  Python Speech recognition, word by word AceScottie 6 16,021 Apr-12-2020, 09:50 AM
Last Post: vinayakdhage
  print a word after specific word search evilcode1 8 4,863 Oct-22-2019, 08:08 AM
Last Post: newbieAuggie2019
  can't figure out problem with number guess Galoxys 4 3,354 Oct-29-2018, 01:45 PM
Last Post: snippsat
  Guess a number Ameen 5 13,137 Apr-03-2018, 01:20 PM
Last Post: snippsat
  difference between word: and word[:] in for loop zowhair 2 3,686 Mar-03-2018, 07:24 AM
Last Post: zowhair
  Guess Random Number Why i m not able to enter input Nithya Thiyagarajan 6 8,226 Jan-07-2018, 04:26 AM
Last Post: squenson

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020