Complete the comprehension
# {'a': 1, 'b': 2} -> {1: 'a', 2: 'b'}
flipped = {v: k for k, v in d.____()}
Answer: items
items() gives the pairs the comprehension swaps.
Play Problem Solving ▸
# {'a': 1, 'b': 2} -> {1: 'a', 2: 'b'}
flipped = {v: k for k, v in d.____()}
Answer: items