擅长:python、mysql、java
<p>您可以使用列表理解:</p>
<pre><code>In [1]: urls = ['https://wipp.edmundsassoc.com/Wipp/?wippid=1205',
'https://wipp.edmundsassoc.com/Wipp/?wippid=1206']
In [2]: ["{}#taxpage{}".format(url, page_num) for page_num in xrange(1, 4) for url in urls]
Out[2]:
['https://wipp.edmundsassoc.com/Wipp/?wippid=1205#taxpage1',
'https://wipp.edmundsassoc.com/Wipp/?wippid=1206#taxpage1',
'https://wipp.edmundsassoc.com/Wipp/?wippid=1205#taxpage2',
'https://wipp.edmundsassoc.com/Wipp/?wippid=1206#taxpage2',
'https://wipp.edmundsassoc.com/Wipp/?wippid=1205#taxpage3',
'https://wipp.edmundsassoc.com/Wipp/?wippid=1206#taxpage3']
</code></pre>