From 7da022d939fc8a851dd06b99ea4394fb87f75c00 Mon Sep 17 00:00:00 2001 From: Abigail Date: Tue, 12 Oct 2021 15:55:04 +0200 Subject: Python solutions for week 134 --- challenge-134/abigail/python/ch-1.py | 11 +++++++++++ challenge-134/abigail/python/ch-2.py | 19 +++++++++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 challenge-134/abigail/python/ch-1.py create mode 100644 challenge-134/abigail/python/ch-2.py (limited to 'challenge-134/abigail/python') diff --git a/challenge-134/abigail/python/ch-1.py b/challenge-134/abigail/python/ch-1.py new file mode 100644 index 0000000000..74f9f35566 --- /dev/null +++ b/challenge-134/abigail/python/ch-1.py @@ -0,0 +1,11 @@ +#!/opt/local/bin/python + +# +# See ../README.md +# + +# +# Run as: python ch-1.py +# + +for t in [789, 798, 879, 897, 978]: print (1023456000 + t) diff --git a/challenge-134/abigail/python/ch-2.py b/challenge-134/abigail/python/ch-2.py new file mode 100644 index 0000000000..4f07debc11 --- /dev/null +++ b/challenge-134/abigail/python/ch-2.py @@ -0,0 +1,19 @@ +#!/opt/local/bin/python + +# +# See ../README.md +# + +# +# Run as: python ch-2.py < input-file +# + +import fileinput + +for line in fileinput . input (): + [n, m] = line . split () + seen = {} + for i in range (int (n)): # 0 .. (n - 1) + for j in range (int (m)): # 0 .. (m - 1) + seen [(i + 1) * (j + 1)] = 1 + print (len (seen)) -- cgit