<pre><code>def drop dest(routes,location):
for i in range(len(routes)):
if routes[i] == location:
routes.remove(routes[i])
return routes
</code></pre>
<p>我使用的是一个给定列表的函数定义,<br/><code>routes = [(3,2),(2,4),(5,5),(2,4)]</code>,并说我只想删除<code>(2,4)</code>的第一个出现值。我有点困惑如何做,因为我删除了值,但我也删除了其他给定的值。我只想删除第一个给定值。</p>