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

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

  •  
  •   gdw1986 · Nov 10, 2020 · 2573 views
    This topic created in 1998 days ago, the information mentioned may be changed or developed.
    最近在看算法哈,遇到个问题就是,比如一个数组我可能需要临时的去掉一个元素,下一个循环呢我可能要把它加回来,我现在能想到的办法就是用 deepcopy 到另外一个临时数组,请问各位大佬有别的好办法吗?
    6 replies    2020-12-07 18:50:35 +08:00
    helloworld000
        1
    helloworld000  
       Nov 10, 2020
    哥们你这不是算法问题,是能否清楚的用中文进行表达的问题...
    maocat
        2
    maocat  
       Nov 10, 2020 via Android
    if item=='xxx':
    continue
    gdw1986
        3
    gdw1986  
    OP
       Nov 10, 2020
    @maocat 哦,直接跳过是个办法
    quanjw
        4
    quanjw  
       Nov 10, 2020
    size 定义下数组长度
    akatquas
        5
    akatquas  
       Nov 10, 2020
    filter
    shm7
        6
    shm7  
       Dec 7, 2020 via iPhone
    @helloworld000 感觉都是“7 天精通 python 2 周深入深度学习” 最近好多问 print 怎么写这种问题的
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2646 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 62ms · UTC 14:26 · PVG 22:26 · LAX 07:26 · JFK 10:26
    ♥ Do have faith in what you're doing.