Built-in Reviews


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)
        return "Nope"


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.


Look good to me. Try refreshing the page.


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