19.) Review Built In Functions The -10 Problem


#1

So I get his error when I run my code: Oops, try again. Your function seems to fail on input -10 when it returned 'False' instead of '10' How do I go about fixing this?


def distance_from_zero(brad):
    if type(brad) == int or type(brad) == float
        return abs(brad)
    else:
        return "Nope"


#2

@bibleman13

You are missing a colon :

if type(brad) == int or type(brad) == float


#3

Thank you very much! Hate when that happens :smiley:


#4

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