Built-in Reviews


#1



My code seems correct, but I keep getting the following error

File "python", line 3
return abs(r):
^
SyntaxError: invalid syntax


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


#2

I don't understand. Your description says abs(r) while the code says abs(y). Your code is alright. I copy pasted your code in my python interpreter and it worked fine.


#3

Look good to me. Try refreshing the page.


#4

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