Find a random word in the dictionary that starts with a particular letter.
Run the code to get a list of all the words in the dictionary:
Show words beginning with “x”. Try a different starting letter:
The pattern “x”~~___ matches an “x” followed by one or more letters:
You can combine letters and blanks to find words matching all sorts of patterns. Here are words that start and end with “x”:
Make a random choice among words beginning with “x”. Try a different starting letter:
RandomChoice chooses an element at random from a list. Re-run the code to get a different choice:
Choose a word at random that starts with “x”:
Choose 5 random words beginning with “x”. Try other numbers:
Specify the number of words to get more than one:
Use RandomSample to get random words that don’t repeat: