Copyright © tutorialspoint.com

Python dictionary items() Method

previous next


Description:

This class method returns a list of dict's (key, value) tuple pairs

Syntax:

dict.items()

Parameters:

Here is the detail of parameters:

Example:

#!/usr/bin/python

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

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


This produces following result:

Value : [('Age', 7), ('Name', 'Zara')]

previous next

Copyright © tutorialspoint.com