Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Sum ARGV

import sys

def mysum(*numbers):
    print(numbers)
    total = 0
    for s in numbers:
        total += s
    return total

v = [int(x) for x in sys.argv[1:] ]
r = mysum( *v )
print(r)