Added method for iteration

This commit is contained in:
2026-02-10 18:43:47 -05:00
parent 470bbb28a1
commit aa90a9b4ee

View File

@@ -8,3 +8,9 @@ def sum_cards_iter(cards: list[Card]) -> int:
return total
#Added for project 2: Created a function to sum a list of Card objects using iteration.
def sum_cards_iter(cards: list[Card]) -> int:
total = 0
for card in cards:
total = total + card
return total
#Added for project 2: Created a function to sum a list of Card objects using iteration.