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

请问这是 Python 的什么用法

  •  
  •   Pangolin1984 · Mar 6, 2020 · 2619 views
    This topic created in 2255 days ago, the information mentioned may be changed or developed.
    >>> ('a','b')[0]
    'a'

    >>> ('a','b')[1]
    'b'

    >>>
    10 replies    2020-04-06 21:19:57 +08:00
    Pangolin1984
        2
    Pangolin1984  
    OP
       Mar 6, 2020
    @yangyaofei 闲的吧你,还加一条推广链接
    also24
        3
    also24  
       Mar 6, 2020
    刚想认真回答,看到 2 楼……
    EileenJ
        4
    EileenJ  
       Mar 6, 2020 via Android
    没记错的话,小括号是元组
    xiaowei0823
        5
    xiaowei0823  
       Mar 6, 2020
    这应该算是普通用法
    CEBBCAT
        6
    CEBBCAT  
       Mar 6, 2020 via Android
    通过下标取元组元素,有什么奇怪之处呢?
    CEBBCAT
        7
    CEBBCAT  
       Mar 6, 2020 via Android
    五年前的账号,三年前就接触 Python,今天问了这样没头没脑的问题……关键是楼主也有放狗的意识,陷入迷思……
    yangyaofei
        8
    yangyaofei  
       Mar 6, 2020 via Android
    @also24 我觉得我的回答和他的回复挺配的,和他的提问一个味儿😎
    ShawnSky
        9
    ShawnSky  
       Mar 12, 2020
    很寻常的用法
    linvaux
        10
    linvaux  
       Apr 6, 2020
    这个问题是认真的吗???
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1246 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 41ms · UTC 17:38 · PVG 01:38 · LAX 10:38 · JFK 13:38
    ♥ Do have faith in what you're doing.