Review Build in Functions:


#1



https://www.codecademy.com/courses/python-beginner-c7VZg/4/3?curriculum_id=4f89dab3d788890003000096#


This code looks right to me, what am I missing?


def distance_from_zero(name):
    if type(name) == int or type(name) == float:
        return abs(name)
    else:
        return 'nope'


#2

Instruction:

Otherwise, the function should return "Nope"

string should be an exact match.

so it should be Nope


#3

Thank you! That would have drove me nuts for a very long time!


#4

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