Complete the code to import the FastAPI class.
from fastapi import [1] app = FastAPI()
The FastAPI class is imported to create the app instance.
Complete the code to define a GET route that returns a welcome message.
@app.[1]("/") async def root(): return {"message": "Welcome!"}
The GET method is used to retrieve data from the server.
Fix the error in the code to connect to a SQLite database using SQLAlchemy.
from sqlalchemy import create_engine engine = create_engine("sqlite:///[1]")
The database file name must be specified correctly for SQLite connection.
Fill both blanks to create a dictionary comprehension that stores word lengths for words longer than 3 characters.
{word: [1] for word in words if len(word) [2] 3}The dictionary stores the length of each word, but only for words longer than 3 characters.
Fill all three blanks to create a dictionary comprehension that stores uppercase keys and values for items with positive values.
result = [1]: [2] for k, v in data.items() if v [3] 0}
The comprehension creates a dictionary with uppercase keys and their values only if the value is positive.