Answers for "list's sum"

16

python sum of list

>>> list = [1, 2, 3]
>>> sum(list)
6
Posted by: Guest on January-27-2020
-1

how to do the sum of list in python

def calculate_cards(cards):
    total= 0
    for card in cards:
        total = total + card
    return total
print(calculate_cards([11,7,5]))
Posted by: Guest on August-27-2021

Python Answers by Framework

Browse Popular Code Answers by Language