Random Word
To play the game it is needed to choose one gameword randomly from the word_list. To do that we create choose_word_random function.
Opgave
Swipe to start coding
- Set the
choose_word_randomfunction using theword_listas an argument. - Return random word from the
word_listinside the function usingrandom.choice(...)function. - Test the function using the
test_word_listlist.
Løsning
Var alt klart?
Tak for dine kommentarer!
Sektion 1. Kapitel 2
single
Spørg AI
Spørg AI
Spørg om hvad som helst eller prøv et af de foreslåede spørgsmål for at starte vores chat
Suggested prompts:
Opsummér dette kapitel
Explain code
Explain why doesn't solve task
Awesome!
Completion rate improved to 7.69
Random Word
Stryg for at vise menuen
To play the game it is needed to choose one gameword randomly from the word_list. To do that we create choose_word_random function.
Opgave
Swipe to start coding
- Set the
choose_word_randomfunction using theword_listas an argument. - Return random word from the
word_listinside the function usingrandom.choice(...)function. - Test the function using the
test_word_listlist.
Løsning
Var alt klart?
Tak for dine kommentarer!
Sektion 1. Kapitel 2
single