Coverage for docs_src/parameter_types/number/tutorial002.py: 100%
5 statements
« prev ^ index » next coverage.py v7.6.1, created at 2025-04-14 00:18 +0000
« prev ^ index » next coverage.py v7.6.1, created at 2025-04-14 00:18 +0000
1import typer 1iabcdefgh
4def main( 1abcdefgh
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}") 1iabcdefgh
10 print(f"--rank is {rank}") 1iabcdefgh
11 print(f"--score is {score}") 1iabcdefgh
14if __name__ == "__main__": 1iabcdefgh
15 typer.run(main) 1iabcdefgh