Checks if dates (e.g. ["17", "11"] ) is valid and returns bool

    Checks if the first element is between 1 and 31
    and the second element is between 1 and 12.


    Keyword arguments:
    dates -- list of numbers

    Returns:
    True if the date is valid, False otherwise.

def date_is_valid(dates):
    """Checks if dates (e.g. ["17", "11"] ) is valid and returns bool

    Checks if the first element is between 1 and 31
    and the second element is between 1 and 12.


    Keyword arguments:
    dates -- list of numbers

    Returns:
    True if the date is valid, False otherwise.
    """
    if (int(dates[0]) < 1 or
            int(dates[0]) > 31 or
            int(dates[1]) < 1 or
            int(dates[1]) > 12):

        return False
    return True