Python多条件配合使用

#!/usr/bin/python
#coding=gb2312

items=['aaa',111, (3.4) ,2.03];
tests=[(3.4),112];
for key in tests:
    if key in items:
        print "yes";
    else:
        print "NO";

res=[];
for key in items:
    if key not in tests:
        res.append(key);

print res;

 

posted @ 2013-03-04 15:51  墨迹哥's  阅读(327)  评论(0编辑  收藏  举报