ProblemStatment.py

 avatar
unknown
python
7 months ago
186 B
10
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