Review: Built in functions

def distance_from_zero(n):
	if type(n) == int or type(n) == float:
    return abs(n)
    return "Nope"
  • not quite sure what i’m doing wrong. I’ve got the correct indentation (although it doesn’t show here) but i’m still getting an error. It’s basically identical to the correct code given, but I still receive an error. Any ideas? Or is this just another bug?


i added the format, next time you can do it yourself:

How do I format code in my posts?

so indent shows up, looking at your code:


the indent looks off.


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