how to print all elements of a dictionary in python

for key, value in mydic.items() :
    print (key, value)

Here is what the above code is Doing:
1. We create a dictionary called mydic.
2. We add three key-value pairs to mydic.
3. We iterate over mydic using a for loop.
4. For each key-value pair in mydic, we print the key and the value.