19. review: built-in functions


please help me with this code

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

Built in functions (19)- stuck

the if condition should be in the body of the function, for this indent is needed, why isn’t there indent?

next time, please create a new topic rather then hijacking an existing one see guidelines and use format:

Without format, indent doesn’t show, and then its really difficult to find an indent error


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