From aa90a9b4ee1452961e31e51131dcb4f604acad77 Mon Sep 17 00:00:00 2001 From: Benjamin Adovasio Date: Tue, 10 Feb 2026 18:43:47 -0500 Subject: [PATCH] Added method for iteration --- Project 1/utilities.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Project 1/utilities.py b/Project 1/utilities.py index b78afb9..d4e5d17 100644 --- a/Project 1/utilities.py +++ b/Project 1/utilities.py @@ -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. \ No newline at end of file