|
描述 dict() 函数用于创建一个字典。 语法 以下是 dict 方法的语法: class dict(**kwarg) class dict(mapping, **kwarg) class dict(iterable, **kwarg) 参数 **kwargs -- 关键字 mapping -- 元素的容器。 iterable -- 可迭代对象。 返回值 返回一个字典。 实例 以下实例展示了 dict 的使用方法: |
|
描述 dict() 函数用于创建一个字典。 语法 以下是 dict 方法的语法: class dict(**kwarg) class dict(mapping, **kwarg) class dict(iterable, **kwarg) 参数 **kwargs -- 关键字 mapping -- 元素的容器。 iterable -- 可迭代对象。 返回值 返回一个字典。 实例 以下实例展示了 dict 的使用方法: |