Solve python/exercises/currency-exchange

With help of
https://exercism.org/tracks/python/exercises/currency-exchange/solutions/dollymolly
as I didn't understand the last instruction.
This commit is contained in:
Daniel Siepmann 2024-03-25 09:37:19 +01:00
parent acadad2eac
commit 64e1e4f1c2
Signed by: Daniel Siepmann
GPG key ID: 33D6629915560EF4

View file

@ -72,9 +72,8 @@ def exchangeable_value(budget, exchange_rate, spread, denomination):
:return: int - maximum value you can get.
"""
exchange = exchange_rate / 100
cost = exchange - spread
rate = exchange_rate + exchange_rate * spread / 100
new = exchange_money(budget, rate)
bill = get_number_of_bills(new, denomination)
result = budget - cost * denomination
return result
return get_value_of_bills(denomination, bill)