diff options
| author | Mohammad S Anwar <mohammad.anwar@yahoo.com> | 2021-01-23 23:41:23 +0000 |
|---|---|---|
| committer | Mohammad S Anwar <mohammad.anwar@yahoo.com> | 2021-01-23 23:41:23 +0000 |
| commit | aed29ad93810caa441f2e424a39f3ef94ffaced3 (patch) | |
| tree | bf5ec947fff9f8c5d9aace68eee69d395510692d /challenge-001/abigail/python | |
| parent | 03b70bd180d940e1115b0454dc493fa0351dd127 (diff) | |
| parent | db264d695f319bc1ab3a5069e4dafa11ff39ffab (diff) | |
| download | perlweeklychallenge-club-aed29ad93810caa441f2e424a39f3ef94ffaced3.tar.gz perlweeklychallenge-club-aed29ad93810caa441f2e424a39f3ef94ffaced3.tar.bz2 perlweeklychallenge-club-aed29ad93810caa441f2e424a39f3ef94ffaced3.zip | |
Merge branch 'Abigail-abigail/week-001'
Diffstat (limited to 'challenge-001/abigail/python')
| -rw-r--r-- | challenge-001/abigail/python/ch-1.py | 11 | ||||
| -rw-r--r-- | challenge-001/abigail/python/ch-2.py | 16 |
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 |
