Solution:
As per your question, I understood you want to use a for-loop to print each contact in contact_emails. It means you are willing to print both of the strings in a particular dictionary.
Let’s define some contact_emails first and then use the for-loop to print both of the strings below:
contact_emails = {
'Naymul Hasan' : 'n.hasan@gmail.com',
'Fuad Mostofa': 'mostofa.fuad@ymail.com',
'Rifat Rahman': 'rrahman@gmail.com'
}
for email in contact_emails:
print('%s is %s' % ( contact_emails[email], email))
This program will throw back the output below:
n.hasan@gmail.com is Naymul Hasan
rrahman@gmail.com is Rifat Rahman
mostofa.fuad@mail.com is Fuad Mostofa
Hope this helps you. Thanks.