latvia

Check if list contains another list in python

匿名 (未验证) 提交于 2019-12-03 02:33:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have two lists, one containing lists of album, file pairs and the other containing only info about one photo - album (at position 0) and file (at position 1) photos = [["Trip to Thailand", "IMG_001.jpg"], ["Latvia 2010", "IMG_001.jpg"]] photo = ["Latvia 2010", "IMG_001.jpg"] How to check if photo list is in photos list? Similarly like photo in photos for strings. Position of album , file doesn't matter since there won't be any file equal to album . 回答1: Similarly like photo in photos for strings . Not just similarly, exactly like that .