In this example we will show how to loop through both keys and values in Python.
Source Code
mydict = {
'name': 'Steven',
'age': 24,
'ID': 123456
}
for x, y in mydict.items():
print(x, y)
Output:
name Steven
age 24
ID 123456
In this example we will show how to loop through both keys and values in Python.
mydict = {
'name': 'Steven',
'age': 24,
'ID': 123456
}
for x, y in mydict.items():
print(x, y)
Output:
name Steven
age 24
ID 123456