V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
推荐学习书目
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
Aliencn
V2EX  ›  Python

当 finally 遇上 continue 之 Python 版

  •  
  •   Aliencn · Oct 23, 2018 · 2931 views
    This topic created in 2742 days ago, the information mentioned may be changed or developed.

    avatar

    图床有点慢

    你们猜这三个函数执行结果是什么?

    5 replies    2018-10-24 10:03:14 +08:00
    AnyISalIn
        1
    AnyISalIn  
       Oct 23, 2018
    1. 返回 1
    2. print(0) -> print(1)
    3. 语法错误
    gnozix
        2
    gnozix  
       Oct 23, 2018
    《流畅的 Python 》你值得拥有
    wwqgtxx
        3
    wwqgtxx  
       Oct 23, 2018 via iPhone
    我记得 c()这种写法,专门有一个 pep 规范定义了是非法的语法
    anywalker707
        5
    anywalker707  
       Oct 24, 2018
    return 就直接返回了,为什么还要 continue 和 break 呢?为什么凑 try …… finally 的工整吗
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   845 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 40ms · UTC 21:24 · PVG 05:24 · LAX 14:24 · JFK 17:24
    ♥ Do have faith in what you're doing.