from collections import defaultdict fruit_prices = defaultdict(lambda: "Unknown") fruit_prices["apple"] = 1.0 fruit_prices["banana"] = 0.5 print(fruit_prices["apple"]) # Output: 1.0 print(fruit_prices["banana"]) # Output: 0.5 print(fruit_prices["orange"]) # Output: Unknown
1.0 0.5 Unknown