python判断list中是否包含某个元素
theList = ['a','b','c'] if 'a' in theList: print 'a in the list' if 'd' not in theList: print 'd is not in the list'
本文共 138 字,大约阅读时间需要 1 分钟。
python判断list中是否包含某个元素
theList = ['a','b','c'] if 'a' in theList: print 'a in the list' if 'd' not in theList: print 'd is not in the list'
转载地址:http://jidfm.baihongyu.com/