首页
注册
登录
V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请
登录
V2EX 提问指南
广告
V2EX
›
问与答
(已解決)enumerate(urls, 1),後面這個數字 1 是何作用呢?
llhh
·
2014-10-19 21:54:11 +08:00
· 1783 次点击
这是一个创建于 3640 天前的主题,其中的信息可能已经有所发展或是发生改变。
代碼如下:
for pos,url in enumerate(urls, 1):
if lp in url:
return pos
else:
return -1
google未果,多謝大家!
原來这个参数用来: 指明索引的起始值
是enumerate的第二個參數。
目前尚无回复
urls
enumerate
POS
关于
·
帮助文档
·
博客
·
API
·
FAQ
·
实用小工具
·
918 人在线
最高记录 6679
·
Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 24ms ·
UTC 18:38
·
PVG 02:38
·
LAX 11:38
·
JFK 14:38
Developed with
CodeLauncher
♥ Do have faith in what you're doing.