Everyone knows "99 bottles of beer on the wall".

[Mat's Mug](https://codereview.stackexchange.com/users/23788/mats-mug) made a [comment](http://chat.stackexchange.com/transcript/message/23528511#23528511) about mugs on the wall in [The 2nd Monitor](http://chat.stackexchange.com/rooms/8595/the-2nd-monitor) and I realized I never wrote a "beer on the wall" program. But that seemed way too easy, so I made it a "n number of x on the y" instead. It also seemed like a good excuse to use templates in Python, which I hadn't done before.

```
import sys

n = int(sys.argv[1])
x = sys.argv[2]
y = sys.argv[3]

template = '''\
%i %s on the %s
%i %s
Take one down, pass it around
%i %s on the %s
'''

for n in range(n, 0, -1):
    print template % (n, x, y, n, x, n-1, x, y)

```

Usage:

```
python script.py 99 "mugs of beer" wall

```

For obvious reasons there's no way (that I know of) to remove multiples of `x` if `n = 1`. Sure, it's not hard to turn `mugs of beer` into `mug of beer`, but it's generic. One can input anything and I can't catch all methods of pluralization.

I prefer readability over 'clever code' and my naming is probably not too good.