Complete the code to perform a fast data retrieval using a DynamoDB operation.
response = table.[1](KeyConditionExpression=key_expression)The query operation retrieves items efficiently by using the primary key, making it faster than scan.
Complete the code to retrieve all items from a DynamoDB table, which is slower but scans everything.
response = table.[1]()The scan operation reads every item in the table, which can be slow for large tables.
Fix the error in the code to improve performance by using the correct DynamoDB operation.
items = table.[1](KeyConditionExpression=key_expression)Using query with a key condition is faster than scan with filter expressions.
Fill both blanks to create a dictionary comprehension that filters items with a condition and calculates a value.
result = {item['id']: item['value'] [1] 2 for item in items if item['value'] [2] 10}The ** operator squares the value, and > filters values greater than 10.
Fill all three blanks to build a dictionary comprehension that transforms keys, selects values, and filters items.
filtered = [1]: [2] for [3], v in data.items() if v > 0}
Keys are converted to uppercase with k.upper(), values are kept as v, and iteration uses k.