为了账号安全,请及时绑定邮箱和手机立即绑定

python内建函数?

python内建函数?

狐的传说 2019-02-05 09:05:17
python内建函数
查看完整描述

3 回答

?
萧十郎

TA贡献1815条经验 获得超12个赞

使用dir(__builtins__)可以给出所有内建函数的list

你要使用哪个,打印该函数的__doc__即可知道其用法

比如
>>> dir(map)
['__call__', '__class__', '__cmp__', '__delattr__', '__doc__', '__getattribute__', '__hash__', '__init__', '__module__', '__name__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__self__', '__setattr__', '__str__']
>>> print map.__doc__
map(function, sequence[, sequence, ...]) -> list

Return a list of the results of applying the function to the items of
the argument sequence(s). If more than one sequence is given, the
function is called with an argument list consisting of the corresponding
item of each sequence, substituting None for missing values when not all
sequences have the same length. If the function is None, return a list of
the items of the sequence (or a list of tuples if more than one sequence).
>>>

至于你想要内建函数的详细说明,我是不会给你的(我也没有,呵呵)
但都在文档里面

不知道为什么你们不先看看文档再来问问题呢。。。


查看完整回答
反对 回复 2019-03-15
  • 3 回答
  • 0 关注
  • 609 浏览

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信