Python dict() 函数
Python 教程
· 2019-02-01 18:11:59
描述
dict() 函数用于创建一个字典。
语法
dict 语法:
class dict(**kwarg) class dict(mapping, **kwarg) class dict(iterable, **kwarg)
参数说明:
- **kwargs -- 关键字
- mapping -- 元素的容器。
- iterable -- 可迭代对象。
返回值
返回一个字典。
实例
以下实例展示了 dict 的使用方法:
>>>dict() # 创建空字典
{}
>>> dict(a='a', b='b', t='t') # 传入关键字
{'a': 'a', 'b': 'b', 't': 't'}
>>> dict(zip(['one', 'two', 'three'], [1, 2, 3])) # 映射函数方式来构造字典
{'three': 3, 'two': 2, 'one': 1}
>>> dict([('one', 1), ('two', 2), ('three', 3)]) # 可迭代对象方式来构造字典
{'three': 3, 'two': 2, 'one': 1}
>>>
点击查看所有 Python 教程 文章: https://www.codercto.com/courses/l/8.html
Search User Interfaces
Marti A. Hearst / Cambridge University Press / 2009-9-21 / USD 59.00
搜索引擎的本质是帮助用户更快、更方便、更有效地查找与获取所需信息。在不断改进搜索算法和提升性能(以技术为中心)的同时,关注用户的信息需求、搜寻行为、界面设计与交互模式是以用户为中心的一条并行发展思路。创新的搜索界面及其配套的交互机制对一项搜索服务的成功来说是至关重要的。Marti Hearst教授带来的这本新作《Search User Interfaces》即是后一条思路的研究成果,将信息检索与人......一起来看看 《Search User Interfaces》 这本书的介绍吧!