社区所有版块导航
Python
python开源   Django   Python   DjangoApp   pycharm  
DATA
docker   Elasticsearch  
aigc
aigc   chatgpt  
WEB开发
linux   MongoDB   Redis   DATABASE   NGINX   其他Web框架   web工具   zookeeper   tornado   NoSql   Bootstrap   js   peewee   Git   bottle   IE   MQ   Jquery  
机器学习
机器学习算法  
Python88.com
反馈   公告   社区推广  
产品
短视频  
印度
印度  
Py学习  »  Python

如何使用Python检查两个列表中的两个相同值是否返回true[duplicate]

Cytex • 5 年前 • 1561 次点击  

这个问题已经有了答案:

我有两个像素坐标列表

(confirmed pixel[(60, 176), (60, 174), (63, 163), (61, 176)] & 
white_pixel [(64, 178), (60, 174), (61, 176)])

我想比较两者,如果发现任何相同的值,例如 (61176) (60174) ,它将返回 真的 ,表示至少需要匹配一个值。

我怎么能这样 如果 陈述?

确认的像素=白色像素不起作用 全部的 两个列表中的值必须相同才能返回true

if confirmed_pixel == white_pixel and len(confirmed_pixel) != 0 and len(white_pixel) != 0:
    print("True")
    continue
Python社区是高质量的Python/Django开发社区
本文地址:http://www.python88.com/topic/50385
 
1561 次点击  
文章 [ 2 ]  |  最新文章 5 年前