diff options
| author | Mohammad S Anwar <Mohammad.Anwar@yahoo.com> | 2021-05-23 16:59:39 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-05-23 16:59:39 +0100 |
| commit | 64d90deae0b1c6e8fe708937f775f0975f138a4f (patch) | |
| tree | cf2877cafb333f34246a86a5ab81a0abd8d07899 /challenge-113/abigail/python/ch-2.py | |
| parent | d03259c86c349e8efbbd6622dfdfcaa3c5f527f2 (diff) | |
| parent | 1ab38e5de2d0bbab588c411e7764653217a9fc84 (diff) | |
| download | perlweeklychallenge-club-64d90deae0b1c6e8fe708937f775f0975f138a4f.tar.gz perlweeklychallenge-club-64d90deae0b1c6e8fe708937f775f0975f138a4f.tar.bz2 perlweeklychallenge-club-64d90deae0b1c6e8fe708937f775f0975f138a4f.zip | |
Merge pull request #4120 from Abigail/abigail/week-113
Abigail/week 113
Diffstat (limited to 'challenge-113/abigail/python/ch-2.py')
| -rw-r--r-- | challenge-113/abigail/python/ch-2.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/challenge-113/abigail/python/ch-2.py b/challenge-113/abigail/python/ch-2.py new file mode 100644 index 0000000000..73b6b9bc8b --- /dev/null +++ b/challenge-113/abigail/python/ch-2.py @@ -0,0 +1,16 @@ +#!/opt/local/bin/python + +# +# See ../README.md +# + +# +# Run as: python ch-2.py < input-file +# + +import fileinput + +for line in fileinput . input (): + numbers = list (map (lambda _: int (_), line . split ())) + total = sum (numbers) + print (' ' . join (map (lambda _: str (total - _), numbers))) |
