Review: Built-In Functions


#1

https://www.codecademy.com/courses/learn-python/lessons/functions/exercises/review-built-in-functions?action=lesson_resume&link_content_target=interstitial_lesson

The code is correct as far as I can tell. I may be wrong. I get the following error:
Your function seems to fail on input True when it returned ‘1’ instead of ‘Nope’

Any hints as to why it is doing that? Is it a bug or is it me?
Thank you in advance for the help.

def distanceFromZero(z):
  if type(z) == int or type(z) == float:
    return abs(z)
  
  else:
    return 'Nope'

https://www.codecademy.com/courses/learn-python/lessons/functions/exercises/review-built-in-functions?action=lesson_resume&link_content_target=interstitial_lesson


#2

from the instructions:

First, def a function called distance_from_zero

your function has a slightly different name, cammelcase is more JS style, its really uncommon for function names in python


#3

LOL!

Man thank you again.


#4