Sep-06-2023, 06:51 AM
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:
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?