aboutsummaryrefslogtreecommitdiff
path: root/challenge-001/abigail/python
diff options
context:
space:
mode:
authorMohammad S Anwar <Mohammad.Anwar@yahoo.com>2022-01-04 21:18:56 +0000
committerGitHub <noreply@github.com>2022-01-04 21:18:56 +0000
commitd4cc39535ad0f1a187d755bc6371dcea052dfbb8 (patch)
tree15fe4f106d7b76fffb1240816ca220f54dfb99c9 /challenge-001/abigail/python
parentd1581f755d50e5b3a5ccf74a25280f39caa809fc (diff)
parentf1cde8d35ee0e171a8b4090bc8952bdef9e4de1a (diff)
downloadperlweeklychallenge-club-d4cc39535ad0f1a187d755bc6371dcea052dfbb8.tar.gz
perlweeklychallenge-club-d4cc39535ad0f1a187d755bc6371dcea052dfbb8.tar.bz2
perlweeklychallenge-club-d4cc39535ad0f1a187d755bc6371dcea052dfbb8.zip
Merge pull request #5474 from Abigail/abigail/week-001
Abigail/week 001
Diffstat (limited to 'challenge-001/abigail/python')
-rw-r--r--challenge-001/abigail/python/ch-1.py9
-rw-r--r--challenge-001/abigail/python/ch-2.py14
2 files changed, 14 insertions, 9 deletions
diff --git a/challenge-001/abigail/python/ch-1.py b/challenge-001/abigail/python/ch-1.py
index 193586bcf6..047f1a0749 100644
--- a/challenge-001/abigail/python/ch-1.py
+++ b/challenge-001/abigail/python/ch-1.py
@@ -1,11 +1,14 @@
+#!/opt/local/bin/python
+
#
-# See ../READE,md
+# See https://theweeklychallenge.org/blog/perl-weekly-challenge-001
#
#
-# Run as python ch-1.py < input-file
+# Run as: python ch-1.py < input-file
#
+
import fileinput
for line in fileinput . input ():
- print line . replace ("e", "E"), line . count ("e")
+ print (line . replace ("e", "E"), line . count ("e"))
diff --git a/challenge-001/abigail/python/ch-2.py b/challenge-001/abigail/python/ch-2.py
index 9e93cb08e2..17aea9077f 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-001
#
#
-# 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)