跟老齐学Python之数据类型总结(2)
复制代码 代码如下: print dict.__doc__ dict() - new empty dictionary dict(mapping) - new dictionary initialized from a mapping object's (key, value) pairs dict(iterable) - new dictionary initia
复制代码 代码如下:
>>> print dict.__doc__
dict() -> new empty dictionary
dict(mapping) -> new dictionary initialized from a mapping object's
(key, value) pairs
dict(iterable) -> new dictionary initialized as if via:
d = {}
for k, v in iterable:
d[k] = v
dict(**kwargs) -> new dictionary initialized with the name=value pairs
in the keyword argument list. For example: dict(one=1, two=2)
上面那么折腾一下,就是为了凑篇幅,不然这个总结的东西太少了。
总之,只要用这种方法,你就能得到所有帮助文档,随时随地。如果可以上网,到官方网站,是另外一种方法。
还需要再解释别的吗?都多余了。唯一需要的是看官要能会点英语。不过我相信看官能够读懂,我这个二把刀都不如的英语水平,还能凑合看呢,何况看官呢?
总结不是意味着结束,是意味着继往开来。精彩还在后面,这里只是休息。
精彩图集
精彩文章






