From aabd1e84e665aedd395b90c1f60626139db87cc6 Mon Sep 17 00:00:00 2001 From: Milad Bourhani Date: Sat, 19 Jan 2019 14:46:50 +0100 Subject: [PATCH] improved --- my.py | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/my.py b/my.py index 2b2334c..4861473 100644 --- a/my.py +++ b/my.py @@ -1,12 +1,8 @@ import sys -def processLine(line): - return processTokens(line.split()) - -def processTokens(tokens): - mysum = sum( [int(s) for s in tokens if s.isdigit()] ) - return mysum +def sum_numbers(line): + return sum( [int(s) for s in line.split() if s.isdigit()] ) if __name__ == "__main__": for line in sys.stdin: - print(processLine(line)) + print(sum_numbers(line))