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

Python 的 While 循环语句是从数组的最后一个开始判断的?

  •  
  •   anoyafk · 2017-02-09 16:17:30 +08:00 · 3690 次点击
    这是一个创建于 2605 天前的主题,其中的信息可能已经有所发展或是发生改变。

    自学 Python,看到这张 GIF 图,感到疑惑.
    麻烦指教.
    loop-over-python-list-animation

    6 条回复    2017-02-10 11:06:26 +08:00
    holajamc
        1
    holajamc  
       2017-02-09 16:30:14 +08:00
    pop()默认移除列表中的最后一个元素,并且返回该元素的值
    anoyafk
        2
    anoyafk  
    OP
       2017-02-09 16:48:53 +08:00
    @holajamc 是第五行的.pop()吗?
    thanks,我去查一下.
    WKPlus
        3
    WKPlus  
       2017-02-09 16:54:24 +08:00
    最后一个元素判断语句的动画是不是错了,应该是 even.append ,怎么动画里面变成了 odd.append 。
    竟然看到了最后一步,还以为眼花了,又看了一遍。
    fengxueshangu
        4
    fengxueshangu  
       2017-02-09 16:56:33 +08:00
    @WKPlus 确实错了吧
    kingphar
        5
    kingphar  
       2017-02-09 17:59:25 +08:00
    这个动画怎么做出来的?
    yanchao7511461
        6
    yanchao7511461  
       2017-02-10 11:06:26 +08:00
    我也想问,这个动画怎么做出来的
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2864 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 11:18 · PVG 19:18 · LAX 04:18 · JFK 07:18
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.