Exerpad
Exercise 6 · Chapter: DictionariesRequired+50 XP

Fix the Get

This program crashes when you look up a name that isn't in the dictionary. Fix it so it shows 0 for missing names instead of crashing.

Expected: if the name isn't found, print 0 as the score.

Expected output
Alice scored 95
Need a hint?
3 available · costs 5 XP each
python
scores = {"Alice": 95, "Bob": 87}
name = input()
print(f"{name} scored {scores[name]}")
Output
Run your code to see the output here.