Practice ยท 1 of 3
Safe Lookup
stock = {"apple": 5, "pear": 0} is given. Print the count for "banana" without crashing โ use .get() with a default of 0.
Difficulty: beginner
Press Submit to check your solution.
Back to lesson: Practice: Dictionary Drills