标签:
aa=frozenset([‘warning‘,‘baba‘])
bb=frozenset(‘warning‘)
print aa
print bb
if "baba" in aa:
print "1# yes"
if ‘baba‘ in aa:
print "2# yes"
if ‘waring‘ in bb:
print "3# yes"
if ‘w‘ in bb:
print "4# yes"
结果:
frozenset([‘baba‘, ‘warning‘])
frozenset([‘a‘, ‘g‘, ‘i‘, ‘n‘, ‘r‘, ‘w‘])
1# yes
2# yes
4# yes
标签:
原文地址:http://www.cnblogs.com/notlate/p/4674364.html