12 lines
177 B
Python
12 lines
177 B
Python
|
def gettotal(l):
|
||
|
total = 0
|
||
|
for i in l:
|
||
|
total += i
|
||
|
return total
|
||
|
|
||
|
result = gettotal([1, 2, 3, 4, 5])
|
||
|
print(result)
|
||
|
|
||
|
result = gettotal(range(10))
|
||
|
print(result)
|