ProblemStatment.py
unknown
python
a year ago
186 B
12
Indexable
def list_sum(lst):
s = 0
for elem in lst:
s += elem
return s
print(list_sum([5, 4, 3])) #Returns 12 :)
print(list_sum(5)) #Returns TypeError :(Editor is loading...
Leave a Comment