Complete the code to import the FastAPI class from the correct module.
from [1] import FastAPI app = FastAPI()
The FastAPI class is imported from the fastapi module to create the app instance.
Complete the code to define a route handler function for the root path.
@app.[1]("/") async def read_root(): return {"message": "Hello World"}
The @app.get decorator defines a GET route handler for the root path.
Fix the error in the import statement to correctly import the router from the users module.
from app.[1] import router app.include_router(router)
The router is usually defined in the users module to handle user-related routes.
Fill both blanks to create a dictionary comprehension that maps filenames to their sizes for files in the 'static' folder.
file_sizes = {file: [1] for file in os.listdir('static') if os.path.[2]('static/' + file)}os.path.isdir which checks for directories, not files.The comprehension gets the size of each file (not directory) in the 'static' folder.
Fill all three blanks to create a FastAPI app that includes a router and sets a title in metadata.
from fastapi import FastAPI from app.[1] import router app = FastAPI(title=[2]) app.[3](router)
The router is imported from the users module, the app title is set as a string, and the router is included with include_router.