19. review: built-in functions


#1

please help me with this code

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

Built in functions (19)- stuck
#2

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


#3

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