码迷,mamicode.com
首页 > 编程语言 > 详细

python 两个队列进行对比

时间:2018-08-02 23:03:00      阅读:187      评论:0      收藏:0      [点我收藏+]

标签:list   pre   col   code   not   对比   队列   nbsp   bsp   

python 两个队列进行对比

list01 = [1,2,3,4]
list02 = [1,3,5]
for i01 in list01:
    is_in_02 = False
    for i02 in list02:
        if i01 == i02:
            is_in_o2 = True
            print(i01,i02,YES)
            break
     if not is_in_02:
        print(i01,  , NO)
for i02 in list02:
    is_in_01 = False
    for i01 in list01:
        if i02 == i01:
            is_in_01 = True
            break
    if not is_in_01:
        print( , i02, NO)

 

python 两个队列进行对比

标签:list   pre   col   code   not   对比   队列   nbsp   bsp   

原文地址:https://www.cnblogs.com/stono/p/9409776.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!