From b56e9198031fa3bde98e608837856cf2e00cb18c Mon Sep 17 00:00:00 2001 From: Abigail Date: Wed, 20 Jan 2021 12:42:08 +0100 Subject: Python solution for week 1/part 1 --- challenge-001/abigail/python/ch-1.py | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 challenge-001/abigail/python/ch-1.py (limited to 'challenge-001/abigail/python') 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") -- cgit From 72557b3172bec25ae35f036a177332ccd913c143 Mon Sep 17 00:00:00 2001 From: Abigail Date: Thu, 21 Jan 2021 12:57:33 +0100 Subject: Python solution for week 1, part 2 --- challenge-001/abigail/python/ch-2.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 challenge-001/abigail/python/ch-2.py (limited to 'challenge-001/abigail/python') 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 -- cgit