diff options
| author | Abigail <abigail@abigail.be> | 2021-10-12 15:55:04 +0200 |
|---|---|---|
| committer | Abigail <abigail@abigail.be> | 2021-10-12 15:55:04 +0200 |
| commit | 7da022d939fc8a851dd06b99ea4394fb87f75c00 (patch) | |
| tree | a63f2db49f2b847178887cd2141606e33c3092ed /challenge-134/abigail/python | |
| parent | 62f97af917432bd79b6ccb2303c349370bbc2bbe (diff) | |
| download | perlweeklychallenge-club-7da022d939fc8a851dd06b99ea4394fb87f75c00.tar.gz perlweeklychallenge-club-7da022d939fc8a851dd06b99ea4394fb87f75c00.tar.bz2 perlweeklychallenge-club-7da022d939fc8a851dd06b99ea4394fb87f75c00.zip | |
Python solutions for week 134
Diffstat (limited to 'challenge-134/abigail/python')
| -rw-r--r-- | challenge-134/abigail/python/ch-1.py | 11 | ||||
| -rw-r--r-- | challenge-134/abigail/python/ch-2.py | 19 |
2 files changed, 30 insertions, 0 deletions
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)) |
