擅长:python、mysql、java
<p>您可以这样做:</p>
<pre><code>station_list = [1, 2, 3, 4]
start = 1 # item = 2 is at index position 1!
for item in (station_list[start:] + station_list[:start]):
# your code here
</code></pre>
<p>这将输出:</p>
<pre><code>[2, 3, 4, 1]
</code></pre>
<p>您可以在python<a href="http://pythoncentral.io/how-to-slice-listsarrays-and-tuples-in-python/" rel="nofollow noreferrer">here</a>中了解有关切片的更多信息</p>
<p>如果您想获得一些关于Python中列表的额外信息,<a href="https://www.tutorialspoint.com/python/python_lists.htm" rel="nofollow noreferrer">this</a>可能会有所帮助。你知道吗</p>