擅长:python、mysql、java
<p>如果要搜索的值(索引)可能是元组的第一个或第二个值,则基本方法是:</p>
<pre><code>segmentation1 = [('874', '893'), ('964', '985')]
segmentation2 = [('901', '931')] # frame indexes in vid
for (x, y) in segmentation1:
if x == '893' or y == '893':
print('found')
</code></pre>
<p>这里以字符串“893”为例。您必须先将数字索引转换为字符串。你知道吗</p>