Shakespeare’s chock-full of puns, no doubt as a sign of his mastery and love of words.

Rarely can you swap two words to form a correct grammatically sentence, yet he played with words like a magician.

Better a witty fool than a foolish wit.

Twelfth Night

In the example above, the noun “fool” flips to the adjective “foolish”, while the adjective “witty” flips to the noun “wit”. The simplest puns leverage the rules of grammar to change the meaning of words.

Then there are puns that play with phrases in a way that leverages context outside the grammar to change the meaning. Here’s one of my favorites:

Put out the light, and then put out the light.