From 4bb05f879039205fc2ea5fbaf16ed9d706fd064a Mon Sep 17 00:00:00 2001 From: Abigail Date: Tue, 4 Jan 2022 14:49:23 +0100 Subject: Week 1: Fix Python errors. --- challenge-001/abigail/python/ch-1.py | 9 ++++++--- challenge-001/abigail/python/ch-2.py | 14 ++++++++------ 2 files changed, 14 insertions(+), 9 deletions(-) (limited to 'challenge-001/abigail/python') diff --git a/challenge-001/abigail/python/ch-1.py b/challenge-001/abigail/python/ch-1.py index 193586bcf6..ddb4e89f78 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-000 # # -# 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..3c445c4ce3 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-000 # # -# 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) -- cgit From f1cde8d35ee0e171a8b4090bc8952bdef9e4de1a Mon Sep 17 00:00:00 2001 From: Abigail Date: Tue, 4 Jan 2022 21:26:40 +0100 Subject: Week 1: Fix references --- challenge-001/abigail/python/ch-1.py | 2 +- challenge-001/abigail/python/ch-2.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'challenge-001/abigail/python') diff --git a/challenge-001/abigail/python/ch-1.py b/challenge-001/abigail/python/ch-1.py index ddb4e89f78..047f1a0749 100644 --- a/challenge-001/abigail/python/ch-1.py +++ b/challenge-001/abigail/python/ch-1.py @@ -1,7 +1,7 @@ #!/opt/local/bin/python # -# See https://theweeklychallenge.org/blog/perl-weekly-challenge-000 +# See https://theweeklychallenge.org/blog/perl-weekly-challenge-001 # # diff --git a/challenge-001/abigail/python/ch-2.py b/challenge-001/abigail/python/ch-2.py index 3c445c4ce3..17aea9077f 100644 --- a/challenge-001/abigail/python/ch-2.py +++ b/challenge-001/abigail/python/ch-2.py @@ -1,7 +1,7 @@ #!/opt/local/bin/python # -# See https://theweeklychallenge.org/blog/perl-weekly-challenge-000 +# See https://theweeklychallenge.org/blog/perl-weekly-challenge-001 # # -- cgit