Find errors and rewrite the same after correcting the following code:
d1.key()
The correct method to retrieve all keys from a dictionary is keys(), not key().
keys()
The corrected code is:
d1.keys()