Name

.items()

Examples

element_names = {'H': 'hydrogen', 'He': 'helium', 'Li': 'lithium'}
element_items = element_names.items()

# Prints [('Li', 'lithium'), ('H', 'hydrogen'), ('He', 'helium')]
print(element_items)

# Iterate over each item of the dictionary:
for k, val in element_names.items():
	print("The name of element " + k + " is " + val)

Description
Syntax
	dict.items()
Parameters
dict
Related Dictionary
Updated on Wed Jan 18 17:32:21 2017.
Creative Commons License