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
wyntergreg
V2EX  ›  Python

如何机智的解释"there is only one way to do it"?

  •  
  •   wyntergreg · 2017 年 3 月 17 日 · 1886 次点击
    这是一个创建于 3317 天前的主题,其中的信息可能已经有所发展或是发生改变。

    给测试部的同事培训 Python 基础,我把这句列在语言特点中了,讲到这里的时候脑子突然闪过字符串赋值单双引号,大脑瞬间尴尬后直接讲"任何事物都有打脸的一面,比如字符串赋值..."囧

    PythonAnswer
        1
    PythonAnswer  
       2017 年 3 月 17 日 via Android
    字符串引号是可以活用的。

    one best way to do it, called pythonic way
    wyntergreg
        2
    wyntergreg  
    OP
       2017 年 3 月 17 日
    @PythonAnswer 如何活法,明明是单双引号通用么, python3 默认字符串双引号会转为单引号
    不过嵌套用的时候则按照定义顺序来,是否就是活在这了...手动滑稽
    hihihihihi
        3
    hihihihihi  
       2017 年 3 月 17 日
    never say never!
    msg7086
        4
    msg7086  
       2017 年 3 月 18 日
    只有一种最好的做法。
    至于哪种是最好的做法,可以吵几年。
    关于   ·   帮助文档   ·   自助推广系统   ·   博客   ·   API   ·   FAQ   ·   Solana   ·   887 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 55ms · UTC 21:32 · PVG 05:32 · LAX 14:32 · JFK 17:32
    ♥ Do have faith in what you're doing.