Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

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]))
Source by www.geeksforgeeks.org #
 
PREVIOUS NEXT
Tagged: #sum #list #python
ADD COMMENT
Topic
Name
4+8 =