Answers for "how to sum all line items in list python without using sum function"

2

how to sum numbers of a list in python without sum

please subscribe my channel - https://bit.ly/2Me2CfB

# METHOD 1 (without using the sum function) :

def list_sum(list_name): 
    value = 0 
    for values in list_name:
        value += values
        print(value)
        
        
# -------------------------------------------


# METHOD 2 (using the sum function) :

p = [1,5,3,4,6,7]
p_sum = sum(p)
Posted by: Guest on July-09-2021
-1

how to add all values in a list python without using sum function

def int_list(grades):   #list is passed to the function
    summ = 0 
    for n in grades:
        summ += n
        print summ
Posted by: Guest on September-27-2020

Code answers related to "how to sum all line items in list python without using sum function"

Python Answers by Framework

Browse Popular Code Answers by Language