Spaces:
Sleeping
Sleeping
fix typo
Browse files- __pycache__/main.cpython-311.pyc +0 -0
- main.py +2 -3
__pycache__/main.cpython-311.pyc
CHANGED
|
Binary files a/__pycache__/main.cpython-311.pyc and b/__pycache__/main.cpython-311.pyc differ
|
|
|
main.py
CHANGED
|
@@ -1,7 +1,6 @@
|
|
| 1 |
from fastapi import FastAPI, HTTPException
|
| 2 |
import random
|
| 3 |
import json
|
| 4 |
-
import math
|
| 5 |
import secrets
|
| 6 |
import string
|
| 7 |
import faker
|
|
@@ -9,7 +8,7 @@ import faker
|
|
| 9 |
app = FastAPI()
|
| 10 |
|
| 11 |
|
| 12 |
-
def generate_random_int(left: int = 0, right: int =
|
| 13 |
"""Generate a random integer within the given range."""
|
| 14 |
return random.randint(left, right)
|
| 15 |
|
|
@@ -42,7 +41,7 @@ def get_root() -> dict:
|
|
| 42 |
return {"float": random.random()}
|
| 43 |
|
| 44 |
|
| 45 |
-
@app.get("random/int")
|
| 46 |
def get_random_int() -> dict:
|
| 47 |
"""Return a random integer."""
|
| 48 |
return {"int": generate_random_int()}
|
|
|
|
| 1 |
from fastapi import FastAPI, HTTPException
|
| 2 |
import random
|
| 3 |
import json
|
|
|
|
| 4 |
import secrets
|
| 5 |
import string
|
| 6 |
import faker
|
|
|
|
| 8 |
app = FastAPI()
|
| 9 |
|
| 10 |
|
| 11 |
+
def generate_random_int(left: int = 0, right: int =10**100) -> int:
|
| 12 |
"""Generate a random integer within the given range."""
|
| 13 |
return random.randint(left, right)
|
| 14 |
|
|
|
|
| 41 |
return {"float": random.random()}
|
| 42 |
|
| 43 |
|
| 44 |
+
@app.get("/random/int")
|
| 45 |
def get_random_int() -> dict:
|
| 46 |
"""Return a random integer."""
|
| 47 |
return {"int": generate_random_int()}
|