Radar. Kayak. Rotator. Sexes. What do these words all have in common? They’re palindromes, words that are spelled the same forward and backward. Even better are palingrams, whole phrases that behave the same way. Napoleon is the author of the most famous palingram. When he first saw Elba, the island of his exile, he said, “Able was I ere I saw Elba.”

In 2011, DC Comics published an interesting story that made clever use of palingrams. The superhero sorceress Zatanna was cursed so that she could cast spells only by speaking palindromically. She managed to think up just enough two-word phrases like nurses run, stack cats ...

Get Impractical Python Projects now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.