V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
推荐学习书目
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
mengzx
V2EX  ›  Python

Python 递归问题求解

  •  1
     
  •   mengzx · 2017-05-10 10:24:40 +08:00 · 1478 次点击
    这是一个创建于 2544 天前的主题,其中的信息可能已经有所发展或是发生改变。
    在递归时没有办法获取字典上一层的 name 值和 depth 值,求大神指导下
    4 条回复    2018-08-18 13:10:02 +08:00
    mengzx
        1
    mengzx  
    OP
       2017-05-10 10:26:27 +08:00
    wwqgtxx
        2
    wwqgtxx  
       2017-05-10 11:03:19 +08:00 via iPhone
    递归的时候通过参数把父元素传进去不就好
    mengzx
        3
    mengzx  
    OP
       2018-08-18 12:30:31 +08:00
    @livid 能帮忙删除这个主题吗,谢谢。
    mengzx
        4
    mengzx  
    OP
       2018-08-18 13:10:02 +08:00
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   3148 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 78ms · UTC 00:11 · PVG 08:11 · LAX 17:11 · JFK 20:11
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.