Describe
The Python dictionary (Dictionary) items () function returns an array of traversed (key, value) tuples in a list.
Grammar
The items () method syntax:
Dict.items ()
Parameters
NA.
return value
Returns an array of (key, value) tuples that can be traversed.
Instance
The following example shows how to use the items () function:
#!/usr/bin/pythondict = {' Name ': ' Zara ', ' age ': 7}print ' Value:%s '% dict.items ()
The result of the above example output is:
Value: [(' Age ', 7), (' Name ', ' Zara ')]
"Recommended"
1. Special recommendation : "PHP Programmer Toolkit" V0.1 version download
2. Python Free video tutorial
3. The item () function in Python traverses the instance of the dictionary
4. the use of the items () series functions in Python
5. introduction of three ways to access dictionaries
6. Python Basics Getting Started items () method