Hi, guys!
I’m stuck in this exercise. I have made a solution that is returning the right answer (apparently) but, in the test, the return is completly different. can someone help me, please?
Here is my code:
def exchangeable_value(budget, exchange_rate, spread, denomination):
"""
:param budget: float - the amount of your money you are planning to exchange.
:param exchange_rate: float - the unit value of the foreign currency.
:param spread: int - percentage that is taken as an exchange fee.
:param denomination: int - the value of a single bill.
:return: int - maximum value you can get.
"""
final_rate = exchange_rate + (spread / 100)
final_budget = budget / final_rate
final_value = final_budget - (final_budget % denomination)
return int(final_value)