Complete the code to set the default page size to 10 in the API response.
page_size = [1]The default page size is set to 10 to limit the number of items returned per page.
Complete the code to extract the current page number from the request query parameters.
current_page = request.args.get('[1]', 1, type=int)
The 'page' parameter is commonly used to specify the current page number in pagination.
Fix the error in calculating the offset for the database query.
offset = (current_page [1] 1) * page_size
Offset is calculated by subtracting 1 from the current page number, then multiplying by page size.
Fill both blanks to create a dictionary comprehension that maps each item id to its name for items on the current page.
page_items = {item['[1]']: item['[2]'] for item in items}We use 'id' as the key and 'name' as the value to create the dictionary of items.
Fill all three blanks to filter items with price greater than 100 and create a dictionary with item names as keys and prices as values.
filtered_items = {item['[1]']: item['[2]'] for item in items if item['[3]'] > 100}We use 'name' as the key, 'price' as the value, and filter by 'price' greater than 100.