Write a Python function that takes a list of integers as a parameter and returns the sum of the elements in the list. Thank you.
code :
otuput :
raw_code :
def list_sum(integers):
total_sum = 0
#iterating list to sum elements
for i in integers:
total_sum += i #summing elements
return total_sum #returning sum
integers = [1,2,3,4]
print(list_sum(integers)) #calling function
***do comment for queries and rate me up***
Get Answers For Free
Most questions answered within 1 hours.