Review buit-in functions


def distance_from_zero(a):
if (a) == int or float :
return abs(a)
else :
return "nope"
Your function seems to fail on input True when it returned '1' instead of 'Nope'


you need to do comparison at both side of the or operator, otherwise python will always evaluate float to true


how do i do that.
do i use <> these symbols


if you want your indent to show up on the forum, select your code and press </> button


is how to solve your problem in the exercise, so you can move on to the next exercise


thanks dude i like how you answered me


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