推荐学习书目
› 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 · 12352 views
    This topic created in 3386 days ago, the information mentioned may be changed or developed.

    python 菜鸟,请大家赐教

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

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

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