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

查看所有标签

Building Web Reputation Systems

Building Web Reputation Systems

Randy Farmer、Bryce Glass / Yahoo Press / 2010 / GBP 31.99

What do Amazon's product reviews, eBay's feedback score system, Slashdot's Karma System, and Xbox Live's Achievements have in common? They're all examples of successful reputation systems that enable ......一起来看看 《Building Web Reputation Systems》 这本书的介绍吧!

RGB转16进制工具
RGB转16进制工具

RGB HEX 互转工具

在线进制转换器
在线进制转换器

各进制数互转换器

Base64 编码/解码
Base64 编码/解码

Base64 编码/解码