From 907b063a2cc041fc02194bd0cb09242657d078d8 Mon Sep 17 00:00:00 2001 From: Benjamin Adovasio Date: Tue, 10 Feb 2026 18:52:11 -0500 Subject: [PATCH] Added more comments --- Project 1/utilities.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Project 1/utilities.py b/Project 1/utilities.py index fab3909..9b7effd 100644 --- a/Project 1/utilities.py +++ b/Project 1/utilities.py @@ -5,16 +5,18 @@ from __future__ import annotations from Card import Card def sum_cards_iter(cards: list[Card]) -> int: - total = 0 + total = 0 #start total at 0 for card in cards: - total = total + card + total = total + card return total #Added for project 2: Created a function to sum a list of Card objects using iteration. def sum_cards_recursive(cards: list[Card]) -> int: if cards == []: + #Base case return 0 return cards[0] + sum_cards_recursive(cards[1:]) + #Recursive case #Added for project 2: Created a function to sum a list of Card objects using recursion. def test_sum_cards():