Review: Built In Functions(I need help)


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

i wrote the same code it want me to run .
However, i want to test if it will return for me the absolute value of the arguments and i am stuck i couldn’t let it print anything on the console.
Any suggestions?


#2

for a function to execute, the function needs to be called. To test your function, add some function calls and provide a suitable argument


#3

you are right
I forgot :slight_smile:


#4

so, all good now? Now you remember, you can figure out how to test your function? Then you did most of the work, nicely done :slight_smile: i just gave a notch in the right direction


#5

haha thank you i have been working for four hours maybe that why i forgot about it…


#6

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