Loading

python 两个队列进行对比

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')

 

posted @ 2018-08-02 20:46  stono  阅读(359)  评论(0编辑  收藏  举报