Getting syntax error on else, what is wrong?


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


else should be at the same indent level as if, so you have if/else


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