Complete the code to add a search parameter to the API endpoint URL.
url = "https://api.example.com/items?[1]=book"
The correct search parameter key is search to filter items by keyword.
Complete the code to extract the search parameter value from the URL query string.
search_term = request.args.get('[1]')
The parameter name to get the search term is search.
Fix the error in the code to correctly check if the search parameter exists.
if '[1]' in request.args:
The correct key to check in request.args is search.
Fill both blanks to build a URL with search and sort parameters.
url = f"https://api.example.com/items?[1]=phone&[2]=asc"
The first parameter is search for the keyword, and the second is sort for sorting order.
Fill all three blanks to create a dictionary comprehension filtering items by search term length and sorting by price.
filtered = {item['name']: item['price'] for item in items if len(item['name']) [1] [2] and item['price'] [3] 100}The comprehension filters items with names longer than 3 characters and prices less than or equal to 100.