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:
parent
acadad2eac
commit
64e1e4f1c2
|
@ -72,9 +72,8 @@ def exchangeable_value(budget, exchange_rate, spread, denomination):
|
||||||
:return: int - maximum value you can get.
|
:return: int - maximum value you can get.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
exchange = exchange_rate / 100
|
rate = exchange_rate + exchange_rate * spread / 100
|
||||||
cost = exchange - spread
|
new = exchange_money(budget, rate)
|
||||||
|
bill = get_number_of_bills(new, denomination)
|
||||||
|
|
||||||
result = budget - cost * denomination
|
return get_value_of_bills(denomination, bill)
|
||||||
|
|
||||||
return result
|
|
||||||
|
|
Loading…
Reference in a new issue