The 365 Data Science team is proud to invite you to our own community forum. A very well built system to support your queries, questions and give the chance to show your knowledge and help others in their path of becoming Data Science specialists.
Ask
Anybody can ask a question
Answer
Anybody can answer
Vote
The best answers are voted up and moderated by our team

Built-in Functions exercises not working

Built-in Functions exercises not working

0
Votes
1
Answer
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 Answer

365 Team
0
Votes

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 

×
Ready to Learn
Data Science?
50% OFF