Skip to content

Commit

Permalink
improved
Browse files Browse the repository at this point in the history
  • Loading branch information
miladhub committed Jan 19, 2019
1 parent 00dbcaa commit aabd1e8
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions my.py
Original file line number Diff line number Diff line change
@@ -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))

0 comments on commit aabd1e8

Please sign in to comment.