[英]Search for a string in a tuple inside a Python list
I have a list
in Python, 我有一份Python
list
,
a=[("title","artiste"),
("titl","artste"),
("ttle","titl")]
I want to create a second list; 我想创建第二个列表; the second list should not include the search term.
第二个列表不应包含搜索词。
How to search whether "titl"
is in the first string of the tuples (just the first string, not the second string) of the three tuples or not? 如何搜索
"titl"
是否在三个元组的第一个字符串中(只是第一个字符串,不是第二个字符串)?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.