Given a nested dict and list of keys, traverse and return value. Example: {'a':{'b':1}}, ['a','b'] => 1. Return None if path invalid.
Implement this function:
def nested_lookup(d: dict, keys: list):
Write the function only — the arguments are read for you and the return value is printed automatically.
Arguments arrive as one Python literal per line, in this order: d, keys.
Input
{'a': {'b': 1}}
['a', 'b']
Output
1