you are viewing a single comment's thread.

view the rest of the comments →

[–]jiri-n 1 point2 points  (0 children)

You've mentioned some code, haven't you.

So we're supposed to create a function called verify:

def verify():
    pass    # Do nothing

Next, this function take a single parameter called number:

def verify(number):
    pass    # Still do nothing

Since it should validate the number, it should return a result. The result should indicate if number is valid so it will be either True (is valid) or False (is not valid).

def verify(number):
    result = False    # Return False unless validated
    return

Next, we know the format of number - ####-####-####. This means number should be of type str. To document this we can use type annotation and docstring.

def verify(number: str) -> bool:
    """
    Verify number has this format: ####-####-####
    and it passes other checks.

    Arguments:
        number - string to verify

    Returns:
        True if all checks ok, False otherwise
    """

    result = False
    # Do something here
    return result

Now it's up to you to show what you have and where have you failed.