擅长:python、mysql、java
<p>按索引从列表中选择一个项目,而不是另一个列表的字符串,PLAYER\u NAME['31000']?!在</p>
<pre><code>PLAYER_NAME = ['brad-brach','oliver-drake',...]
PLAYER_ID = ['31000','31615',...]
for i in xrange(len(PLAYER_NAME)):
url = 'http://espn.go.com/mlb/player/_/id/{}/{}'.format(PLAYER_ID[i], PLAYER_NAME[i])
</code></pre>
<p>要获得更优雅的解决方案,请使用zip,感谢@Pynchia;)</p>
^{pr2}$