Review: Built-In Functions


#1


Not sure what I'm doing wrong with this question.


def distance_from_zero(a):
    if type(a) == int or if type(a) == float:
        return abs(a)
    else:
        return 'Nope'


#2

You are attempting to put a second if statement in there

if type(a) == int or if type(a) == float:

if type(a) == int or type(a) == float:

#3

Try to think of the syntax as

if this or that:

Not:

if this or if that:

#4

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