LearnPy Hub
← Context Managers problems
Easy

Ignore a Missing Key

A dictionary is {'a': 1, 'b': 2}. For each input key on one line, print its value inside with contextlib.suppress(KeyError):, so missing keys print nothing. Print done at the end.

Input

Keys separated by spaces.

Output

Several lines.

Sample 1

Input
a b c
Output
1
2
done

Sample 2

Input
z
Output
done
solution.py
Output appears here
Ignore a Missing Key · Python practice problem · LearnPy Hub