Problem:
What’s wrong with my codes? Can anybody please pull me up?
# add_list([1, 2, 3]) should return 6
# summarize([1, 2, 3]) should return "The sum of [1, 2, 3] is 6."
# Note: both functions will only take *one* argument each.
added_list = list()
sum = 0
def add_list(num):
added_list.append(num)
def sum(num):
sum = sum + add_list[num]
for num in 4:
add_list(num)
sum(num)
print(sum)
Thanks in advance.