Random Word Generator
How to choose the word for the game?
To play the game, it is necessary to choose one game word randomly from the word_list
. To do that, we create the choose_word_random
function.
Compito
Swipe to start coding
- Define the function
choose_word_random
withword_list
as a parameter. - Inside the function, return a randomly selected word from
word_list
using therandom.choice(...)
method.
Soluzione
9
1
2
def choose_word_random(word_list):
return random.choice(word_list)
Mark tasks as Completed
Tutto è chiaro?
Grazie per i tuoi commenti!
Sezione 1. Capitolo 2
Chieda ad AI
Chieda pure quello che desidera o provi una delle domande suggerite per iniziare la nostra conversazione