#I don't know what to do?

26 messages · Page 1 of 1 (latest)

nocturne bough
#

Exchange exercise python.

lunar juniper
#

Could you share your code and the error using a codeblock? Images are hard to read and harder to copy paste text from.

nocturne bough
#

how to share using codeblock

#

?

twin zephyrBOT
lunar juniper
#

```
Paste code here
```

nocturne bough
#
def exchange_money(budget,exchange_rate):
    return (budget/exchange_rate)
def get_change(budget,exchanging_value):
    return budget-exchanging_value
def get_value_of_bills(denomination,number_of_bills):
    return denomination*number_of_bills
def get_numbers_of_bills(amount,denomination):
    return int(amount/denomination)
def get_leftover_of_bills(amount,denomination):
    return (amount/denomination)-get_numbers_of_bills(amount,denomination)
def exchangeable_value(budget,exchange_rate,spread,denomination):
    exchange_rate+=exchange_rate*(spread/100)
    return int((budget/exchange_rate)/denomination)*denomination
lunar juniper
#

What are you stuck on?

nocturne bough
#

they give me an error

lunar juniper
#

Ah. You're getting an error? Could you share the error using a codeblock?

nocturne bough
#
Hint: make sure your test modules.packages have valid Python names.
Traceback:
: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
: in <module>
    from exchange import (
E   ImportError: cannot import name 'get_number_of_bills' from 'exchange```
lunar juniper
#

It looks like your error message got cut off

#

The error shows cannot import name 'get_number_of_bills'

#

Does your code have a function named get_number_of_bills? You may want to use the Ctrl-F find to check that.

nocturne bough
#

yes

lunar juniper
#

Can you copy/paste the get_number_of_bills line from your code?

#

Or, better yet, copy/paste get_number_of_bills into Ctrl-F

nocturne bough
#
    return int(amount/denomination) ```
lunar juniper
#

When I search that for get_number_of_bills it says zero matches

#
>>> "get_number_of_bills" in "def get_numbers_of_bills(amount,denomination):\n    return int(amount/denomination)"
False
nocturne bough
#

I discover the problem

lunar juniper
#

🥳

nocturne bough
#

with the s

#

def get_numbers_of_bills(amount,denomination):
return int(amount/denomination)

#

thank you

lunar juniper
#

You're welcome