aboutsummaryrefslogtreecommitdiff
path: root/challenge-001/abigail/python
diff options
context:
space:
mode:
author冯昶 <seaker@qq.com>2021-03-15 18:13:51 +0800
committer冯昶 <seaker@qq.com>2021-03-15 18:13:51 +0800
commit8b6be37fe4dac8b4c6489a95e55514b76b298d15 (patch)
treeae36c8ec2c71f606c0e36adaa19dba366a68a0b4 /challenge-001/abigail/python
parent865acfd056fb6f409ec6b1a81d60b931cbcb69fe (diff)
parentc9aec2da6bcb04b488183f09ca94bee488557aff (diff)
downloadperlweeklychallenge-club-8b6be37fe4dac8b4c6489a95e55514b76b298d15.tar.gz
perlweeklychallenge-club-8b6be37fe4dac8b4c6489a95e55514b76b298d15.tar.bz2
perlweeklychallenge-club-8b6be37fe4dac8b4c6489a95e55514b76b298d15.zip
Merge branch 'master' of github.com:seaker/perlweeklychallenge-club
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