aboutsummaryrefslogtreecommitdiff
path: root/challenge-001/abigail/python
diff options
context:
space:
mode:
authorMohammad S Anwar <mohammad.anwar@yahoo.com>2021-01-23 23:40:04 +0000
committerMohammad S Anwar <mohammad.anwar@yahoo.com>2021-01-23 23:40:04 +0000
commitdb264d695f319bc1ab3a5069e4dafa11ff39ffab (patch)
treebf5ec947fff9f8c5d9aace68eee69d395510692d /challenge-001/abigail/python
parent03b70bd180d940e1115b0454dc493fa0351dd127 (diff)
parent0f5c21ad90c5f91fe51b3f053edac74e420ff536 (diff)
downloadperlweeklychallenge-club-db264d695f319bc1ab3a5069e4dafa11ff39ffab.tar.gz
perlweeklychallenge-club-db264d695f319bc1ab3a5069e4dafa11ff39ffab.tar.bz2
perlweeklychallenge-club-db264d695f319bc1ab3a5069e4dafa11ff39ffab.zip
Merge branch 'abigail/week-001' of git://github.com/Abigail/perlweeklychallenge-club into Abigail-abigail/week-001
Diffstat (limited to 'challenge-001/abigail/python')
-rw-r--r--challenge-001/abigail/python/ch-1.py11
-rw-r--r--challenge-001/abigail/python/ch-2.py16
2 files changed, 27 insertions, 0 deletions
diff --git a/challenge-001/abigail/python/ch-1.py b/challenge-001/abigail/python/ch-1.py
new file mode 100644
index 0000000000..193586bcf6
--- /dev/null
+++ b/challenge-001/abigail/python/ch-1.py
@@ -0,0 +1,11 @@
+#
+# See ../READE,md
+#
+
+#
+# Run as python ch-1.py < input-file
+#
+import fileinput
+
+for line in fileinput . input ():
+ 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
new file mode 100644
index 0000000000..9e93cb08e2
--- /dev/null
+++ b/challenge-001/abigail/python/ch-2.py
@@ -0,0 +1,16 @@
+#
+# See ../READ.md
+#
+
+#
+# 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