推荐学习书目
› 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 · 3452 views
    This topic created in 3768 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   ·   2482 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 13:51 · PVG 21:51 · LAX 06:51 · JFK 09:51
    ♥ Do have faith in what you're doing.