My issue
why my solution return ' '.join(['_']*len(word)) is incorrect?
My code
import time
import random
def choose_word():
words = ['codechef', 'programming', 'learning', 'practice', 'contests', 'rating']
return random.choice(words)
def wordDisplay(word):
display_word = ''
# Update the code below this line
return ' '.join(['_']*len(word))
if __name__ == '__main__':
word = choose_word()
print("Word selected for this round is '" + word + "'")
print("String displayed during the game is", wordDisplay(word))
Learning course: Python Projects for Beginners
Problem Link: Hangman - Blanks in Python Projects for Beginners