- Related Questions & Answers
- Python program to find Cumulative sum of a list
- Program to find sum of widths of all subsequences of list of numbers in Python
- How to Find the Sum of Natural Numbers using Python?
- How to Find Sum of Natural Numbers Using Recursion in Python?
- How to find the greatest number in a list of numbers in Python?
- Python program to find sum of elements in list
- Find groups of strictly increasing numbers in a list in Python
- Find sum of elements in list in Python program
- Program to find largest sum of non-adjacent elements of a list in Python
- Program to find number of arithmetic subsequences from a list of numbers in Python?
- Program to find number of arithmetic sequences from a list of numbers in Python?
- Program to find minimum possible sum by changing 0s to 1s k times from a list of numbers in Python?
- Program to find sum of non-adjacent elements in a circular list in python
- Program to find the sum of first n odd numbers in Python
- Python Program to Find the Total Sum of a Nested List Using Recursion

- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who

Python's built-in function sum() returns sum of numbers in an iterable object such as list or tuple. It takes two arguments, initial value which is optional and 0 by default and iterable object

>>> l1=[10,20,30,40,50] >>> ttl=sum(l1) >>> ttl 150 >>> ttl=sum(range(10)) >>> ttl 45

Advertisements