Latest web development tutorials

Python3 dictionary items () method

Python3 dictionary Python3 dictionary


description

Python dictionary items () method to return the list to traverse the (key, value) tuples array.

grammar

items () method syntax:

dict.items()

parameter

  • NA.

return value

Returns traversal (key, value) tuples array.

Examples

The following example shows the items () method to use:

#!/usr/bin/python3

dict = {'Name': 'w3big', 'Age': 7}

print ("Value : %s" %  dict.items())

The above example output is:

Value : dict_items([('Age', 7), ('Name', 'w3big')])

Python3 dictionary Python3 dictionary