python-CSD-kursu/python-temel/return.3.py

8 lines
139 B
Python

def gettotal(l):
total = 0
for i in l:
total += i
return total
result = gettotal([1, 2, 3, 4, 5])
print(result)