top of page

Write a program to Find the Sum of the list in Python

Updated: Dec 16, 2021

See the flowchart below to understand how the code will work.




Code:

ListSum = []    #crate a empty list in Python
                #takes input for number of elements in list
num = int(input("How many numbers you want to Add: "));
for n in range(num):
    numbers=int(input("Enter numbers: "));
    ListSum.append(numbers)
print("Sum of numbers in list: ",sum(ListSum))

output:







You can also add Negative number in the list. See the out below :








Read More:

Find Factorial of Number

Program to Swap Two variables

Check whether given string is Palindrome or not

Program to Reverse a list

Convert Snake_Case to CamelCase

Print Fibonacci Series

Multiply List in Python




The Tech Platform

www.thetechplatform.com

0 comments
bottom of page