I need help on this python


#1

I don't get what is wrong with this it is giving my this error message

File "python", line 1
def distance_from_zero(numb)
^
SyntaxError: invalid syntax

here is my code

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


#2

Remember to open the block with a colon.

def my_func(n):

#3

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