Skip to content

cli

app = Typer(add_completion=False) module-attribute

main(n: Annotated[int, Argument(min=0, help='The input n of fact(n)')]) -> None

Compute factorial of a given input.

Source code in src/fact/cli.py
13
14
15
16
17
@app.command()
def main(n: Annotated[int, Argument(min=0, help="The input n of fact(n)")]) -> None:
    """Compute factorial of a given input."""

    Console().print(f"fact({n}) = {factorial(n)}")