diff options
| author | E7-87-83 <fungcheokyin@gmail.com> | 2022-01-13 16:52:50 +0800 |
|---|---|---|
| committer | E7-87-83 <fungcheokyin@gmail.com> | 2022-01-13 16:52:50 +0800 |
| commit | b82ed7c55b6a912b237e7fa396e433ac33ca79c8 (patch) | |
| tree | af2ad93bf0190b04d9c3775c87ab3dd61abd99dd /challenge-001/abigail/python | |
| parent | 415b77f3f489715d7888de8794affe9afe8d1ffb (diff) | |
| parent | f0bd80b2369212d923d8c6a537ba5379067afbf9 (diff) | |
| download | perlweeklychallenge-club-b82ed7c55b6a912b237e7fa396e433ac33ca79c8.tar.gz perlweeklychallenge-club-b82ed7c55b6a912b237e7fa396e433ac33ca79c8.tar.bz2 perlweeklychallenge-club-b82ed7c55b6a912b237e7fa396e433ac33ca79c8.zip | |
-
Diffstat (limited to 'challenge-001/abigail/python')
| -rw-r--r-- | challenge-001/abigail/python/ch-1.py | 9 | ||||
| -rw-r--r-- | challenge-001/abigail/python/ch-2.py | 14 |
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) |
