Try now in the
Open Cloud »
(no sign-in required)

Pick a Word Beginning with X

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:

In[1]:=
X
Out[1]=

Show words beginning with x. Try a different starting letter:

SHOW/HIDE DETAILS

The pattern x~~___ matches an x followed by one or more letters:

In[1]:=
X
Out[1]=

You can combine letters and blanks to find words matching all sorts of patterns. Here are words that start and end with x:

In[2]:=
X
Out[2]=

HIDE DETAILS
In[1]:=
X
Out[1]=

Make a random choice among words beginning with x. Try a different starting letter:

SHOW/HIDE DETAILS

RandomChoice chooses an element at random from a list. Re-run the code to get a different choice:

In[1]:=
X
Out[1]=

Choose a word at random that starts with x:

In[2]:=
X
Out[2]=

HIDE DETAILS
In[1]:=
X
Out[1]=

Choose 5 random words beginning with x. Try other numbers:

SHOW/HIDE DETAILS

Specify the number of words to get more than one:

In[1]:=
X
Out[1]=

Use RandomSample to get random words that dont repeat:

In[2]:=
X
Out[2]=

HIDE DETAILS
In[1]:=
X
Out[1]=