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

如何理解这条语句

  •  1
     
  •   maltoze ·
    maltoze · Apr 14, 2016 · 3780 views
    This topic created in 3708 days ago, the information mentioned may be changed or developed.
    g = [lambda x: x*i for i in range(4)]
    g[0](2)    # 6
    g[1](2)    # 6
    g[2](2)    # 6
    g[3](2)    # 6
    

    为什么执行结果都一样啊?

    3 replies    2016-04-22 13:28:20 +08:00
    SoloCompany
        1
    SoloCompany  
       Apr 14, 2016   ❤️ 1
    请搜索惰性求值
    lll9p
        2
    lll9p  
       Apr 14, 2016   ❤️ 1
    yutiyi
        3
    yutiyi  
       Apr 22, 2016
    这是一道经典面试题 https://segmentfault.com/a/1190000000618513 里面问题四
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5391 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 44ms · UTC 06:58 · PVG 14:58 · LAX 23:58 · JFK 02:58
    ♥ Do have faith in what you're doing.