Here is my code, I need to sum an undefined number of elements in the list. How to do this?
l = raw_input() l = l.split(\' \') l.pop(0)
My
>>> l = raw_input() 1 2 3 4 5 6 7 8 9 10 >>> l = l.split() >>> l.pop(0) '1' >>> sum(map(int, l)) #or simply sum(int(x) for x in l) , you've to convert the elements to integer first, before applying sum() 54