#51 niNety-nniinE BoOttels

In this version of the song “Ninety-Nine Bottles,” the program introduces small imperfections in each stanza by either removing a letter, swapping the casing of a letter, transposing two letters, or doubling a letter.

As the song continues to play, these mutations add up, resulting in a very silly song. It’s a good idea to try Project 50, “Ninety-Nine Bottles,” before attempting this one.

The Program in Action

When you run ninetyninebottles2.py, the output will look like this:

niNety-nniinE BoOttels, by Al Sweigart al@inventwithpython.com
--snip-- 99 bottles of milk on the wall, 99 bottles of milk, Take one down, ...

Get The Big Book of Small Python Projects now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.