Answers for "Write a function called sum of list(a list) that takes as its only parameter a list of numbers and return as its output the sum of the list of numbers"

7

how to sum all the numbers in a list in python

# to sum all the numbers we use python's sum() function
a = [4,5,89,5,33,2244,56]
a_total = sum(a)
Posted by: Guest on February-25-2021
3

python To find the sum of all the elements in a list.

lst = []
num = int(input('How many numbers: '))
for n in range(num):
    numbers = int(input('Enter number '))
    lst.append(numbers)
print("Sum of elements in given list is :", sum(lst))
Posted by: Guest on August-18-2020

Code answers related to "Write a function called sum of list(a list) that takes as its only parameter a list of numbers and return as its output the sum of the list of numbers"

Python Answers by Framework

Browse Popular Code Answers by Language