Try to fix transient refleaks in test_asynchat.
[python.git] / Demo / scripts / beer.py
blobe331cc9f8403ac30d61c9f99df31a086b35b3395
1 #! /usr/bin/env python
3 # By GvR, demystified after a version by Fredrik Lundh.
5 import sys
7 n = 100
8 if sys.argv[1:]:
9 n = int(sys.argv[1])
11 def bottle(n):
12 if n == 0: return "no more bottles of beer"
13 if n == 1: return "one bottle of beer"
14 return str(n) + " bottles of beer"
16 for i in range(n, 0, -1):
17 print bottle(i), "on the wall,"
18 print bottle(i) + "."
19 print "Take one down, pass it around,"
20 print bottle(i-1), "on the wall."