Generation

generate functionSun, 13 Nov 2022

sum up a list of numbers

def sum(arr): total = 0 for num in arr: total += num return total sum([1, 2, 3, 4, 5])

Questions about programming?Chat with your personal AI assistant