diff --git a/decorator_exercise.py b/decorator_exercise.py index 9da34c7..323549e 100644 --- a/decorator_exercise.py +++ b/decorator_exercise.py @@ -17,7 +17,7 @@ def factorial(n): return 1 if n == 0 else n * factorial(n - 1) # Step 5: Test the decorator -print(factorial(20)) # Replace with any number to test +print(factorial(2)) # Replace with any number to test ''' How this code works: This code defines a decorator indicate and three functions avg_two, avg_three, and avg_many_kwargs , each decorated with indicate. Here's a brief description of each component: diff --git a/dict_merge.py b/dict_merge.py index 79461bf..592d6b0 100644 --- a/dict_merge.py +++ b/dict_merge.py @@ -1,6 +1,7 @@ # Merging two dictionaries in Python dict_a = {'a': 1, 'b': 2} dict_b = {'c': 3, 'd': 4} +dict_c = {'e': 5, 'f': 6} -my_dict = {**dict_a, **dict_b} -print(my_dict) +my_dict = {**dict_a, **dict_b, **dict_c} +print(my_dict) \ No newline at end of file diff --git a/discounted_list_prices.py b/discounted_list_prices.py index a7e7a8b..2b03a5e 100644 --- a/discounted_list_prices.py +++ b/discounted_list_prices.py @@ -1,7 +1,7 @@ # List of product prices product_prices = [1.50, 2.50, 3.00, 0.99, 2.30] -def apply_discount(prices): +def apply_discount(product_prices): prices_copy = product_prices.copy() for index in range(len(prices_copy)): if prices_copy[index] > 2.00: diff --git a/playing_cards.py b/playing_cards.py index f343d89..983e389 100644 --- a/playing_cards.py +++ b/playing_cards.py @@ -75,7 +75,9 @@ if __name__ == "__main__": print(card) print(f"Remaining cards in the deck: {deck.remaining_cards()}") + ''' player1_hand.add_card(Card('Hearts', 'Ace')) print("Player 1's hand after adding an Ace of Hearts:") for card in player1_hand.cards: print(card) + '''