摘要: 今天在搜用Python求阶乘的时候, 搜出来的最简单的是用reduce这个built-in function, 但是我在用reduce的时候, 却报NameError: name 'reduce' is not defined. 于是又搜了一下,发现在python 3.0.0.0以后, reduce 阅读全文
posted @ 2017-04-30 10:25 云ime 阅读(244) 评论(0) 推荐(0) 编辑
摘要: sqrt() 方法返回数字x的平方根 语法: 注意:sqrt()是不能直接访问的,需要导入 math 模块,通过静态对象调用该方法。 import math # This will import math module print ("math.sqrt(100) : ", math.sqrt(10 阅读全文
posted @ 2017-04-30 09:58 云ime 阅读(841) 评论(0) 推荐(0) 编辑