Coverage for docs_src / parameter_types / number / tutorial001_py39.py: 100%
7 statements
« prev ^ index » next coverage.py v7.13.1, created at 2026-02-09 12:36 +0000
« prev ^ index » next coverage.py v7.13.1, created at 2026-02-09 12:36 +0000
1import typer 1abcdefgh
3app = typer.Typer() 1abcdefgh
6@app.command() 1abcdefgh
7def main( 1abcdefgh
8 id: int = typer.Argument(..., min=0, max=1000),
9 age: int = typer.Option(20, min=18),
10 score: float = typer.Option(0, max=100),
11):
12 print(f"ID is {id}") 1abcdefgh
13 print(f"--age is {age}") 1abcdefgh
14 print(f"--score is {score}") 1abcdefgh
17if __name__ == "__main__": 1abcdefgh
18 app() 1abcdefgh