Python dictionary system keys() returns a roll of entire the obtainable keys in the glossary. keys() technique in Python Dictionary, revisits a vision object that exhibits a list of entire the keys in the vocabulary. Parameters: There are no parameters. Revisits: A outlook object is rivaled that shows all the keys. This view object modifies following the transforms in the dictionary.
Following is the syntax for keys() method:
dict.keys()
This method returns a list of all the available keys in the dictionary.
The following example shows the usage of the keys() method.
#!/usr/bin/python dict = {'Name': 'Zara', 'Age': 7} print "Value : %s" % dict.keys()
When we run the above program, it produces the following result:
Value : ['Age', 'Name']
Here at Intellinuts, we have created a complete Python tutorial for Beginners to get started in Python.