{"record":{"id":"cd20b8dd24223505","repo":"TheAlgorithms/Python","slug":"the-denominator-must-be-an-integer","errorCode":null,"errorMessage":"The Denominator must be an integer","messagePattern":"The Denominator must be an integer","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"maths/numerical_analysis/proper_fractions.py","lineNumber":29,"sourceCode":"    ['1/10', '3/10', '7/10', '9/10']\n    >>> proper_fractions(5)\n    ['1/5', '2/5', '3/5', '4/5']\n    >>> proper_fractions(-15)\n    Traceback (most recent call last):\n        ...\n    ValueError: The Denominator Cannot be less than 0\n    >>> proper_fractions(0)\n    []\n    >>> proper_fractions(1.2)\n    Traceback (most recent call last):\n        ...\n    ValueError: The Denominator must be an integer\n    \"\"\"\n\n    if denominator < 0:\n        raise ValueError(\"The Denominator Cannot be less than 0\")\n    elif isinstance(denominator, float):\n        raise ValueError(\"The Denominator must be an integer\")\n    return [\n        f\"{numerator}/{denominator}\"\n        for numerator in range(1, denominator)\n        if gcd(numerator, denominator) == 1\n    ]\n\n\nif __name__ == \"__main__\":\n    from doctest import testmod\n\n    testmod()\n","sourceCodeStart":11,"sourceCodeEnd":41,"githubUrl":"https://github.com/TheAlgorithms/Python/blob/f5988cc09713315817df6a7e327e258013a94440/maths/numerical_analysis/proper_fractions.py#L11-L41","documentation":"Error \"The Denominator must be an integer\" thrown in TheAlgorithms/Python.","triggerScenarios":"Thrown at maths/numerical_analysis/proper_fractions.py:29 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass an integer denominator, not a float or other type."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"f5988cc09713315817df6a7e327e258013a94440","analyzedAt":"2026-08-14T17:30:07.041Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}