如何查看python内置函数源码


当前第2页 返回上一页

1

2

3

4

5

6

7

8

9

10

11

12

13

14

def expovariate(self, lambd):

        """Exponential distribution.

        lambd is 1.0 divided by the desired mean.  It should be

        nonzero.  (The parameter would be called "lambda", but that is

        a reserved word in Python.)  Returned values range from 0 to

        positive infinity if lambd is positive, and from negative

        infinity to 0 if lambd is negative.

        """

        # lambd: rate lambd = 1/mean

        # ('lambda' is a Python reserved word)

  

        # we use 1-random() instead of random() to preclude the

        # possibility of taking the log of zero.

        return -_log(1.0 - self.random())/lambd

更多Python相关技术文章,请访问Python教程栏目进行学习!

以上就是如何查看python内置函数源码的详细内容,更多文章请关注木庄网络博客!!

返回前面的内容

相关阅读 >>

Python elif是什么意思

Python3.x中可以使用中文作为变量名吗

Python实战爬虫视频教程的资料推荐

Python中map函数和reduce函数的使用方法介绍(附代码)

Python中对文件的相关处理操作的介绍(附代码)

Python全栈工程师是干什么的

Python中dateutil模块的理解(附示例)

Python求平均值

Python实现简单http服务器

Python中常用列表方法分享

更多相关阅读请进入《Python》频道 >>




打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...