

Dict Diver
Given a dictionary mapping star names to their magnitude values, write a function find_brightest(stars) that returns the name of the brightest star (the one with the lowest magnitude). If the dictionary is empty, return None.
Examples
find_brightest({'Vega': 0.03, 'Sirius': -1.46, 'Betelgeuse': 0.5})
→ 'Sirius'
find_brightest({})
→ None
solution.py
PYTHON
Saved as you type
Tests
0 of 3 passing- •multiple stars → Siriusfind_brightest({'Vega': 0.03, 'Sirius': -1.46, 'Betelgeuse': 0.5})expected 'Sirius'
- •empty dict → Nonefind_brightest({})expected None
- •single star → Polarisfind_brightest({'Polaris': 1.97})expected 'Polaris'
On the line
+40 XP
Pass all 3 tests to claim it.
