Python 字典(Dictionary) keys()方法

Python 教程 · 2019-02-03 08:11:49

描述

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

语法

keys()方法语法:

dict.keys()

参数

  • NA。

返回值

返回一个字典所有的键。

实例

以下实例展示了 keys()函数的使用方法:

#!/usr/bin/python

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

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

以上实例输出结果为:

Value : ['Age', 'Name']

点击查看所有 Python 教程 文章: https://codercto.com/courses/l/8.html

查看所有标签

Text Algorithms

Text Algorithms

Maxime Crochemore、Wojciech Rytter / Oxford University Press / 1994

This much-needed book on the design of algorithms and data structures for text processing emphasizes both theoretical foundations and practical applications. It is intended to serve both as a textbook......一起来看看 《Text Algorithms》 这本书的介绍吧!

XML 在线格式化
XML 在线格式化

在线 XML 格式化压缩工具

html转js在线工具
html转js在线工具

html转js在线工具

UNIX 时间戳转换
UNIX 时间戳转换

UNIX 时间戳转换