推荐学习书目
› Learn Python the Hard Way
Python Sites
› PyPI - Python Package Index
› http://diveintopython.org/toc/index.html
› Pocoo
值得关注的项目
› PyPy
› Celery
› Jinja2
› Read the Docs
› gevent
› pyenv
› virtualenv
› Stackless Python
› Beautiful Soup
› 结巴中文分词
› Green Unicorn
› Sentry
› Shovel
› Pyflakes
› pytest
Python 编程
› pep8 Checker
Styles
› PEP 8
› Google Python Style Guide
› Code Style from The Hitchhiker's Guide
zeninger
V2EX  ›  Python

Python 计算阶乘的函数是什么?

  •  
  •   zeninger · Jul 29, 2017 · 12231 views
    This topic created in 3353 days ago, the information mentioned may be changed or developed.

    python 菜鸟,请大家赐教

    5 replies  •  2017-07-30 01:02:57 +08:00
    andyhuzhill
        1
    andyhuzhill  
       Jul 29, 2017
    自己写
    metaquant
        2
    metaquant  
       Jul 29, 2017
    可以自己写

    fac = lambda n:reduce(lambda x,y:x*y,range(1,n+1))
    lunaticus7
        3
    lunaticus7  
       Jul 29, 2017
    from operator import mul

    fac = lambda x: reduce(mul, range(1, x + 1))
    SingeeKing
        4
    SingeeKing  
       Jul 29, 2017   ❤️ 3
    import math
    math.factorial(x)
    PythonAnswer
        5
    PythonAnswer  
       Jul 30, 2017 via Android
    4 楼正解。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   2276 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 239ms · UTC 11:26 · PVG 19:26 · LAX 04:26 · JFK 07:26
    ♥ Do have faith in what you're doing.