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

Palindromes of English

Find the words in English that read the same backward and forward.

Run the code to reverse the word rhinoceros. Try other words, like your name:

SHOW/HIDE DETAILS

rhinoceros is a string of letters: the quotes mean that its text, not a computer command.

StringReverse is a Wolfram Language function that reverses a string.

The output doesnt display quotes, but its a string too.

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

Get a list of dictionary words in English:

Note: the list is automatically shortened because it is very long.

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

Select words that have length 10. Try other lengths:

SHOW/HIDE DETAILS

StringLength gives the length of a string in characters:

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

x==y tests if x and y are equal (note that single = means something completely different):

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

Select selects elements from a list according to a criterion (EvenQ tests whether a number is even):

In[4]:=
X
Out[4]=

Weve got to make up our own criterion for Select. To do that, we use a pure function, indicated by # and &:

In[5]:=
X
Out[5]=

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

Find the palindromes of English:

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

Find palindromes with all letters made lower case:

SHOW/HIDE DETAILS

Make a word all lower case:

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

Make a word all upper case:

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

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

Sort by string length:

SHOW/HIDE DETAILS

Sort a list of words alphabetically:

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

Sort a list of words by length:

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

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