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
def calculate_profit(fruit_counts, base_prices, artisan_skill=False): | |
preserves_jar_profit = 0 | |
dehydrator_profit = 0 | |
for fruit, count in fruit_counts.items(): | |
# Calculate profit for preserves jar | |
preserves_jar_profit += (2 * base_prices[fruit] + 50) * count | |
# Calculate profit for dehydrator | |
dehydrator_profit += (7.5 * base_prices[fruit] + 25) * (count // 5) |