]> git.proxmox.com Git - mirror_edk2.git/blame - AppPkg/Applications/Python/Python-2.7.2/Demo/scripts/beer.py
EmbeddedPkg: Extend NvVarStoreFormattedLib LIBRARY_CLASS
[mirror_edk2.git] / AppPkg / Applications / Python / Python-2.7.2 / Demo / scripts / beer.py
CommitLineData
4710c53d 1#! /usr/bin/env python\r
2\r
3# By GvR, demystified after a version by Fredrik Lundh.\r
4\r
5import sys\r
6\r
7n = 100\r
8if sys.argv[1:]:\r
9 n = int(sys.argv[1])\r
10\r
11def bottle(n):\r
12 if n == 0: return "no more bottles of beer"\r
13 if n == 1: return "one bottle of beer"\r
14 return str(n) + " bottles of beer"\r
15\r
16for i in range(n, 0, -1):\r
17 print bottle(i), "on the wall,"\r
18 print bottle(i) + "."\r
19 print "Take one down, pass it around,"\r
20 print bottle(i-1), "on the wall."\r