19.REVIEW Built-in-Functions


#1



https://www.codecademy.com/en/courses/python-beginner-c7VZg/4/3?curriculum_id=4f89dab3d788890003000096#


The code below returns the following error...
Oops, try again. Your function seems to fail on input True when it returned '1' instead of 'Nope'


Why is this error happening?


def distance_fom_zero(arg):
    if type(arg) == int or type(arg) == float:
        return abs(arg)
    else:
        return "Nope"

print distance_from_zero(-4343)


#2

your function:

def distance_fom_zero

the r is missing in from


#3

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.