Review: Built-In Functions


My program works correctly if I just follow the instructions but I want to test other scenario as given below

what if argument s was indeed an integer or float. How can I test that; right now program is only testing the scenario when s is neither int nor float.

def distance_from_zero(s):
    if type(s)== int or type(s)== float:
        return abs(s)
        return "Nope"


I don't quite understand your question :smile:

Right now your if statement is checking whether s is an integer or a float.



To check for both scenarios use this operator !=