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
You can use map function and pythons inbuilt sum() function. It simplifies the solution. And reduces the complexity. a=map(int,raw_input().split()) sum(a) Done!
map
sum()
a=map(int,raw_input().split())
sum(a)