From 82d812d593954b31a8187c65277e29363225dd55 Mon Sep 17 00:00:00 2001 From: Abigail Date: Thu, 20 May 2021 15:18:52 +0200 Subject: Python solutions for week 113 --- challenge-113/abigail/python/ch-2.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 challenge-113/abigail/python/ch-2.py (limited to 'challenge-113/abigail/python/ch-2.py') 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))) -- cgit