changeset 518:4e2d8a7eb188

http://c2.com/cgi/wiki?FizzBuzzTest
author Jeff Hammel <jhammel@mozilla.com>
date Thu, 19 Sep 2013 16:04:50 -0700
parents a075f8a93183
children 8b990efa4648
files python/fizbuzz.py
diffstat 1 files changed, 5 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/python/fizbuzz.py	Thu Sep 19 16:04:50 2013 -0700
@@ -0,0 +1,5 @@
+#!/usr/bin/env python
+
+for i in range(1,101):
+    print ''.join([label for val, label in ((3, 'Fizz'), (5, 'Buzz'))
+                   if not i % val]) or i