python内建函数?

python内建函数


狐的传说
浏览 613回答 3
3回答

萧十郎

使用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, ...]) -> listReturn a list of the results of applying the function to the items ofthe argument sequence(s). If more than one sequence is given, thefunction is called with an argument list consisting of the correspondingitem of each sequence, substituting None for missing values when not allsequences have the same length. If the function is None, return a list ofthe items of the sequence (or a list of tuples if more than one sequence).>>>至于你想要内建函数的详细说明,我是不会给你的(我也没有,呵呵)但都在文档里面不知道为什么你们不先看看文档再来问问题呢。。。
打开App,查看更多内容
随时随地看视频慕课网APP