From aac0d549009c5f3b1cf4f31534f949a5ea752430 Mon Sep 17 00:00:00 2001 From: Rohan Pandit Date: Sun, 14 Jun 2015 13:01:55 -0400 Subject: [PATCH] cleaner and more accurate solution --- 99_Bottles_Problem/Python/rohanp/99_bottles.py | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 99_Bottles_Problem/Python/rohanp/99_bottles.py diff --git a/99_Bottles_Problem/Python/rohanp/99_bottles.py b/99_Bottles_Problem/Python/rohanp/99_bottles.py new file mode 100644 index 00000000..b87aaf5b --- /dev/null +++ b/99_Bottles_Problem/Python/rohanp/99_bottles.py @@ -0,0 +1,11 @@ +#!/usr/bin/env python3 +""" 99 Bottles Problem """ +__author__ = "Rohan Pandit" + + +for i in range(99, 0, -1): + print("{0} {1} of beer on the wall, {0} {1} of beer.".format(i, "bottles" if i > 1 else "bottle" )) + print("Take one down and pass it around, {0} {1} of beer on the wall".format(i - 1 if i > 1 else "no more", "bottles" if i - 1 > 1 else "bottle" )) + +print("No more bottles of beer on the wall, no more bottles of beer.") +print("Go to the store and buy some more, 99 bottles of beer on the wall.")