Skip to content

#387 Pyhton (Dictionary) keys() Counter()  #4

@LiuL0703

Description

@LiuL0703

(Dictionary) keys()
Python 字典(Dictionary) keys() 函数以列表返回一个字典所有的键。
keys()方法语法:

dict.keys()

返回值:

返回一个字典所有的键。

例如:

#!/usr/bin/python
dict = {'Name': 'Zara', 'Age': 7}
print "Value : %s" %  dict.keys()   #Value : ['Age', 'Name']

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions