a = ['cat','dog']
random.choice(a)
How can I choose a random word, and pull out a letter?
I’ve searched and experimented and whatnot but can’t find an answer.
thanks.
I don’t want a random letter,
for instances
I want it to choose a word, cat.
then I want someone to guess either c a or t.
Kind of like hangman
First to pick the word, you use what you published.Then you can make a set from the word to get the set of letters it contains. And you can use it to check whether the input is part of the word and keep the remaining letters.
You can do:
Hope it is useful.