Write a function that TAKES a list of numbers and RETURNS the addition of all its element
def numbersSum(numbers):
result=0
for n in numbers:
result+=n
return result
numbers=[int(x) for x in input("Enter numbers: ").split(',')]
print(f"Sum: {numbersSum(numbers)}")
Comments
Leave a comment