1#!/usr/bin/env python3 2 3""" 4A Python version of the classic "bottles of beer on the wall" programming 5example. 6 7By Guido van Rossum, demystified after a version by Fredrik Lundh. 8""" 9 10import sys 11 12n = 100 13if sys.argv[1:]: 14 n = int(sys.argv[1]) 15 16def bottle(n): 17 if n == 0: return "no more bottles of beer" 18 if n == 1: return "one bottle of beer" 19 return str(n) + " bottles of beer" 20 21for i in range(n, 0, -1): 22 print(bottle(i), "on the wall,") 23 print(bottle(i) + ".") 24 print("Take one down, pass it around,") 25 print(bottle(i-1), "on the wall.") 26