diff options
| author | Mohammad S Anwar <Mohammad.Anwar@yahoo.com> | 2021-10-13 19:31:22 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-10-13 19:31:22 +0100 |
| commit | 6f7a2e3cbbec44cc216c6d0e6a370f9ec60e3c84 (patch) | |
| tree | 0ac9f540650e975d68834fad4197928eda9c20f2 /challenge-134/abigail/python/ch-2.py | |
| parent | ace3e8d314fab84624d1498c05d228e5ab6df16b (diff) | |
| parent | 8d2394c5f5968392ece3d6d73a5f98e267edf40f (diff) | |
| download | perlweeklychallenge-club-6f7a2e3cbbec44cc216c6d0e6a370f9ec60e3c84.tar.gz perlweeklychallenge-club-6f7a2e3cbbec44cc216c6d0e6a370f9ec60e3c84.tar.bz2 perlweeklychallenge-club-6f7a2e3cbbec44cc216c6d0e6a370f9ec60e3c84.zip | |
Merge pull request #5017 from Abigail/abigail/week-134
Abigail/week 134
Diffstat (limited to 'challenge-134/abigail/python/ch-2.py')
| -rw-r--r-- | challenge-134/abigail/python/ch-2.py | 19 |
1 files changed, 19 insertions, 0 deletions
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)) |
