文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>Doctest: The Easiest Testing Tool(Chapter 2 of Python Testing Beginner's Guide)

Doctest: The Easiest Testing Tool(Chapter 2 of Python Testing Beginner's Guide)

时间:2010-11-28  来源:Ray Z

testable  1 def testable(x):
 2     r"""
 3     The testable functin returns the square root of its parameter, or 3, whichever is larger.
 4     >>> testable(7)
 5     3.0
 6     >>> testable(16)
 7     4.0
 8     >>> testable(9)
 9     3.0
10     >>> testable(10) == 10 ** 0.5
11     True
12     """
13     if x < 9:
14         return 3.0
15     return x ** 0.5
相关阅读 更多 +
排行榜 更多 +
进击小巨人最新版

进击小巨人最新版

冒险解谜 下载
吞就完了手机版

吞就完了手机版

冒险解谜 下载
坦克玩具城

坦克玩具城

冒险解谜 下载