aboutsummaryrefslogtreecommitdiff
path: root/challenge-001/abigail/python/ch-2.py
diff options
context:
space:
mode:
authorAbigail <abigail@abigail.freedom.nl>2022-01-04 14:49:23 +0100
committerAbigail <abigail@abigail.freedom.nl>2022-01-04 14:49:23 +0100
commit4bb05f879039205fc2ea5fbaf16ed9d706fd064a (patch)
treea41402148e2cda14e91315f9d2dde71298db965b /challenge-001/abigail/python/ch-2.py
parent102d9a146d673a3b1f0d4744098788c46f74266e (diff)
downloadperlweeklychallenge-club-4bb05f879039205fc2ea5fbaf16ed9d706fd064a.tar.gz
perlweeklychallenge-club-4bb05f879039205fc2ea5fbaf16ed9d706fd064a.tar.bz2
perlweeklychallenge-club-4bb05f879039205fc2ea5fbaf16ed9d706fd064a.zip
Week 1: Fix Python errors.
Diffstat (limited to 'challenge-001/abigail/python/ch-2.py')
-rw-r--r--challenge-001/abigail/python/ch-2.py14
1 files changed, 8 insertions, 6 deletions
diff --git a/challenge-001/abigail/python/ch-2.py b/challenge-001/abigail/python/ch-2.py
index 9e93cb08e2..3c445c4ce3 100644
--- a/challenge-001/abigail/python/ch-2.py
+++ b/challenge-001/abigail/python/ch-2.py
@@ -1,16 +1,18 @@
+#!/opt/local/bin/python
+
#
-# See ../READ.md
+# See https://theweeklychallenge.org/blog/perl-weekly-challenge-000
#
#
-# Run as python ch-2.py < input-file
+# Run as: python ch-2.py < input-file
#
import fileinput
for max in fileinput . input ():
for i in range (1, int (max) + 1):
- print "fizzbuzz" if i % 15 == 0 else\
- "buzz" if i % 5 == 0 else\
- "fizz" if i % 3 == 0 else\
- i
+ print ("fizzbuzz" if i % 15 == 0 else\
+ "buzz" if i % 5 == 0 else\
+ "fizz" if i % 3 == 0 else\
+ i)