各种程序员所写的阶乘算法代码 # -*- coding: utf-8 -*- #新手程序员(递归) def factorial(x): if x == 0: return 1 else: return x * factorial(x - 1) print factorial(6) #有一年 Python 经验的程序员 def Factorial(x): res = 1 for i in xrange(2, x + 1): res *= i return res print Factorial(6…
最近疯狂的学习ruby和python着两门语言,看到书本上一些比较赞同的段子,摘抄并翻译如下: Python的使用之禅 Beautiful is better than ugly. 美丽好过丑陋Explicit is better than implicit. 明示好过暗示Simple is better than complex. 简单好过复杂Complex is better than complicated.复杂好过杂乱Flat is better than nested.平坦好过嵌套Sp…