Created
December 13, 2023 11:55
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Organizing code for readability | |
def calculate_total_cost(item_prices, tax_rate): | |
subtotal = sum(item_prices) | |
tax = subtotal * tax_rate | |
total_cost = subtotal + tax | |
return total_cost |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment