Last answered:

11 Apr 2020

Posted on:

11 Apr 2020

0

Built-in Functions exercises not working

def distance_from_zero(x):
    if type(x) == int or type(x) == float:
        return abs(x)
    else:
        print("Not Possible")
------------------------------------------------------ distane_from_zero(-10) ---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
<ipython-input-20-81d9cd3c2284> in <module>
----> 1 distane_from_zero(-10)

NameError: name 'distane_from_zero' is not defined

-------------------------------------------------

Similar error is what I have been facing in the earlier question I asked in working with this very chapter based exercise ipynb files

1 answers ( 0 marked as helpful)
Instructor
Posted on:

11 Apr 2020

0
Hi Satish! Thanks for reaching out! This means that you may have written, but you have not executed the code that defines the function called "distance_from_zero()". Please make sure to execute this code first, and then proceed with the rest of the code. Hope this helps.
Best,
Martin 

Submit an answer