Got stuck


#1



Replace this line with your code.

Doc2.pdf (227.5 KB)


#2

Don't name your argument the same name as a method

abs and abs


#3

still, its not working


#4

After the word "type" you need to put the name of your argument (in parenthesis)

if type(my_argument) == and so on


#5

Hey! I am having the same issue. Here is my code:

def distance_from_zero(s):

    if type(s) == int or type(s) == float:
        return abs
    
    else:
        return "Nope"

distance_from_zero

Getting the same error as jlord33 (As shown in their pdf)


#6

I found out the problem!

On line 4 of the code I posted above, where it says:

return abs

You need to have:

return abs(s)

#7

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