We can iterate a dictionary using the dictionary, item(), keys(), values() by a for loop.
info = {
'name': 'Jone',
'last_name': 'Doe',
'email': 'jon@example.com',
'phone': '124242344'
}
for x in info:
print(x)
Output:
name
last_name
email
phone
for x in info:
print(info[x])
Output:
Jone
Doe
jon@example.com
124242344
for item in info.values():
print(item)
for item in info.keys():
print(item)
for key, val in info.items():
print(key, val)