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

关于数组的一个小问题请教一下

  •  
  •   gdw1986 · 2020-11-10 10:08:28 +08:00 · 1882 次点击
    这是一个创建于 1262 天前的主题,其中的信息可能已经有所发展或是发生改变。
    最近在看算法哈,遇到个问题就是,比如一个数组我可能需要临时的去掉一个元素,下一个循环呢我可能要把它加回来,我现在能想到的办法就是用 deepcopy 到另外一个临时数组,请问各位大佬有别的好办法吗?
    6 条回复    2020-12-07 18:50:35 +08:00
    helloworld000
        1
    helloworld000  
       2020-11-10 10:16:53 +08:00
    哥们你这不是算法问题,是能否清楚的用中文进行表达的问题...
    maocat
        2
    maocat  
       2020-11-10 10:23:55 +08:00 via Android
    if item=='xxx':
    continue
    gdw1986
        3
    gdw1986  
    OP
       2020-11-10 10:25:10 +08:00
    @maocat 哦,直接跳过是个办法
    quanjw
        4
    quanjw  
       2020-11-10 10:33:05 +08:00
    size 定义下数组长度
    akatquas
        5
    akatquas  
       2020-11-10 20:37:05 +08:00
    filter
    shm7
        6
    shm7  
       2020-12-07 18:50:35 +08:00 via iPhone
    @helloworld000 感觉都是“7 天精通 python 2 周深入深度学习” 最近好多问 print 怎么写这种问题的
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   5306 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 08:09 · PVG 16:09 · LAX 01:09 · JFK 04:09
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.