EasyOutput prediction
Dict comprehension with filter
What does this code print?
d = {"a": 1, "b": 2, "c": 3, "d": 4}
filtered = {k: v for k, v in d.items() if v % 2 == 0}
print(filtered)← → arrow keys to navigate
Sign in to save your progress.
What does this code print?
d = {"a": 1, "b": 2, "c": 3, "d": 4}
filtered = {k: v for k, v in d.items() if v % 2 == 0}
print(filtered)← → arrow keys to navigate
Sign in to save your progress.