推荐学习书目
› 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
mintLeaf
V2EX  ›  Python

这个递归的返回值为什么是 0,1?

  •  
  •   mintLeaf · Jun 8, 2016 · 3456 views
    This topic created in 3769 days ago, the information mentioned may be changed or developed.

    def a(i): if i==0: return i = i - 1
    a(i)
    print i

    a(2)

    2 replies  •  2016-06-08 18:57:40 +08:00
    aheadlead
        1
    aheadlead  
       Jun 8, 2016
    为何不自己跑一下…
    aheadlead
        2
    aheadlead  
       Jun 8, 2016
    (标题也可以改啊)

    你需要调整好你代码的缩进……
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   2256 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 24ms · UTC 06:19 · PVG 14:19 · LAX 23:19 · JFK 02:19
    ♥ Do have faith in what you're doing.