sum, the same name as a built-in function. After the call, the program uses the built-in sum().
def total(values):
sum = 0
for v in values:
sum += v
return sum
print(total([1, 2, 3]), sum([4, 5]))
What happens when the program runs?Log in to join the discussion.
Loading…