Skip to content
dreamcode
dreamcode
Lesson
Practice · Dict comprehensions
  1. Predict
  2. Arrange
  3. Fill in
+20 XP on finish
PREDICT · READ BEFORE YOU WRITE

What is printed by this code?

Trace the program the way the computer would, then make your call before running anything.

stars = {"sirius": 8, "vega": 5, "rigel": 6}
bright = {k: v for k, v in stars.items() if v > 5}
print(bright)