llhh
V2EX  ›  问与答

(已解決)enumerate(urls, 1),後面這個數字 1 是何作用呢?

  •  
  •   llhh · Oct 19, 2014 · 2163 views
    This topic created in 4253 days ago, the information mentioned may be changed or developed.
    代碼如下:
    for pos,url in enumerate(urls, 1):
    if lp in url:
    return pos
    else:
    return -1

    google未果,多謝大家!

    原來这个参数用来: 指明索引的起始值
    是enumerate的第二個參數。
    No Comments Yet
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1578 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 54ms · UTC 16:44 · PVG 00:44 · LAX 09:44 · JFK 12:44
    ♥ Do have faith in what you're doing.