TheAlgorithms/Python · error · AssertionError

The date was evaluated incorrectly. Contact developer.

Error message

The date was evaluated incorrectly. Contact developer.

What it means

Error "The date was evaluated incorrectly. Contact developer." thrown in TheAlgorithms/Python.

Source

Thrown at maths/zellers_congruence.py:143

    # Start math
    if m <= 2:
        y = y - 1
        m = m + 12
    # maths var
    c: int = int(str(y)[:2])
    k: int = int(str(y)[2:])
    t: int = int(2.6 * m - 5.39)
    u: int = int(c / 4)
    v: int = int(k / 4)
    x: int = int(d + k)
    z: int = int(t + u + v + x)
    w: int = int(z - (2 * c))
    f: int = round(w % 7)
    # End math

    # Validate math
    if f != convert_datetime_days[dt_ck.weekday()]:
        raise AssertionError("The date was evaluated incorrectly. Contact developer.")

    # Response
    response: str = f"Your date {date_input}, is a {days[str(f)]}!"
    return response


if __name__ == "__main__":
    import doctest

    doctest.testmod()
    parser = argparse.ArgumentParser(
        description=(
            "Find out what day of the week nearly any date is or was. Enter "
            "date as a string in the mm-dd-yyyy or mm/dd/yyyy format"
        )
    )
    parser.add_argument(
        "date_input", type=str, help="Date as a string (mm-dd-yyyy or mm/dd/yyyy)"

View on GitHub (pinned to f5988cc097)

Solutions

  1. Verify the input date string format (dd-mm-yyyy or dd/mm/yyyy) and valid month/day values.

When it happens

Trigger: Thrown at maths/zellers_congruence.py:143 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of TheAlgorithms/Python@f5988cc097 (2026-08-14). Data as JSON: /api/errors/d50ff519ab9b2c9f. Report an issue: GitHub.