Complete the code to create a dictionary with keys 'a' and 'b' and values 1 and 2.
my_dict = {'a': [1], 'b': 2}The value for key 'a' should be the number 1, not a string or other number.
Complete the code to access the value of key 'name' from the dictionary.
person = {'name': 'Alice', 'age': 30}
print(person[1])To get the value of 'name', use the exact key 'name' with correct case.
Fix the error in the code to add a new key 'city' with value 'Paris' to the dictionary.
data = {'country': 'France'}
data[1] = 'Paris'
print(data)To add a new key-value pair, use square brackets with the new key and assign the value.
Fill both blanks to create a dictionary comprehension that maps numbers to their squares for numbers greater than 2.
squares = {x: x[1]2 for x in range(1, 6) if x [2] 2}Use '**' to square a number and '>' to filter numbers greater than 2.
Fill all three blanks to create a dictionary from a list of tuples, including only items with value greater than 10.
items = [('apple', 5), ('banana', 15), ('cherry', 20)] result = [1]: [2] for [3] in items if [2] > 10}
Use 'fruit' as key, 'count' as value, and unpack tuples with 'for fruit, count'.