Because many people don’t know what the built-in functions in the dictionary are? what's the effect? So in this article, I will introduce the relevant knowledge about the python keys function in the python dictionary. What does the keys function mean? What is the function of this function will be discussed in the next article. get the answer.
First of all, let’s talk about what this function can do?
keys function
Python Dictionary (Dictionary) keys() function returns all the keys of a dictionary as a list.
Syntax
keys() method syntax:
dict.keys()
Parameters
Return value
keys function example
The following example shows how to use the keys() function:#!/usr/bin/python dict = {'Name': 'Zara', 'Age': 7} print "Value : %s" % dict.keys()
Value : ['Age', 'Name']
Python tutorial column on the php Chinese website.
The above is the detailed content of What can the python keys function do? Example analysis. For more information, please follow other related articles on the PHP Chinese website!