Remove keys from a dictionary not present in a given list. Modify in place. Make a copy of keys before iterating.
Implement this function:
def remove_keys_not_in_list(d: dict, l: list) -> None:
Write the function only — the arguments are read for you and the return value is printed automatically.
This function changes its argument in place and returns nothing; the updated d is what gets printed.
Arguments arrive as one Python literal per line, in this order: d, l.
Input
{'a': 1, 'b': 2, 'c': 3}
['a', 'c']
Output
{'a': 1, 'c': 3}