Coverage for docs_src/parameter_types/number/tutorial002.py: 100%
5 statements
« prev ^ index » next coverage.py v7.6.1, created at 2024-09-09 18:26 +0000
« prev ^ index » next coverage.py v7.6.1, created at 2024-09-09 18:26 +0000
1import typer 1habcdefg
4def main( 1abcdefg
5 id: int = typer.Argument(..., min=0, max=1000),
6 rank: int = typer.Option(0, max=10, clamp=True),
7 score: float = typer.Option(0, min=0, max=100, clamp=True),
8):
9 print(f"ID is {id}") 1habcdefg
10 print(f"--rank is {rank}") 1habcdefg
11 print(f"--score is {score}") 1habcdefg
14if __name__ == "__main__": 1habcdefg
15 typer.run(main) 1habcdefg