Copyright © tutorialspoint.com

Python dictionary keys() Method

previous next


Description:

This class method returns a list of all the available keys in the dictionary.

Syntax:

dict.keys()

Parameters:

Here is the detail of parameters:

Example:

#!/usr/bin/python

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

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


This produces following result:

Value : ['Age', 'Name']

previous next

Copyright © tutorialspoint.com