Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Guess the word game help
#3
I think you need to work with lists, strings are difficult! Using ''.join(alist) you can turn the list back into a word.

See if you can complete this:

import random 
  
words = ['accept', 'acting', 'advice', 'beauty',  
         'python', 'before', 'player', 'beyond',  
         'artist', 'branch', 'boards', 'branch']    
 
word = random.choice(words)
wordlist = [ch for ch in word]
print('The word is', len(word), 'letters long ... ')
hintlist = ['*' for ch in word]
aguess = input('Enter a character or a whole word. ')
if aguess == word:
    print('You guessed it! The word was', word)
else:
    for i in range(len(wordlist)):
What should be in the loop?
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 Pedroski55 - Sep-06-2023, 06:51 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  word guessing game, hints STUdevil 1 2,050 Oct-12-2024, 01:53 AM
Last Post: menator01
  word game, how to give hints STUdevil 5 1,847 Oct-07-2024, 06:20 PM
Last Post: STUdevil
  Ask again if wrong guess with While. EduPy 4 3,775 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 3,811 Aug-12-2021, 04:25 PM
Last Post: palladium
  I guess it's about print tsavoSG 2 3,056 Feb-08-2021, 08:34 PM
Last Post: steve_shambles
  Word Game paulmerton4pope 4 3,619 Jul-11-2020, 02:50 PM
Last Post: paulmerton4pope
  Python Speech recognition, word by word AceScottie 6 18,959 Apr-12-2020, 09:50 AM
Last Post: vinayakdhage
  print a word after specific word search evilcode1 8 6,731 Oct-22-2019, 08:08 AM
Last Post: newbieAuggie2019
  can't figure out problem with number guess Galoxys 4 4,422 Oct-29-2018, 01:45 PM
Last Post: snippsat
  Guess a number Ameen 5 16,658 Apr-03-2018, 01:20 PM
Last Post: snippsat

Forum Jump:

User Panel Messages

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