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.
Uppgift
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 allt tydligt?
Tack för dina kommentarer!
Avsnitt 1. Kapitel 2
single
Fråga AI
Fråga AI
Fråga vad du vill eller prova någon av de föreslagna frågorna för att starta vårt samtal
Suggested prompts:
Sammanfatta detta kapitel
Explain code
Explain why doesn't solve task
Awesome!
Completion rate improved to 7.69
Random Word
Svep för att visa menyn
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.
Uppgift
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 allt tydligt?
Tack för dina kommentarer!
Avsnitt 1. Kapitel 2
single