Hey guys. I’ve been trying to pass the 1st exercise in numbers but I can’t get pass task 6. Can anyone who solved it share what did with me cuz its getting frustrating. I asked chatgpt and it wasnt able to solve it either.
Here’s my code that I got from chatgpt:
: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.
“”"
adjusted_exchange_rate = exchange_rate * (1 + spread / 100)
# Calculate the total value you can receive in foreign currency
exchanged_value = budget * adjusted_exchange_rate
# Round down to the nearest denomination (integer division)
exchangeable_value_in_full_bills = int(exchanged_value // denomination)
# Return the total value in foreign currency (in full denomination bills)
return exchangeable_value_in_full_bills * denomination