yyyyyyyyyyyyyyyyyyyy

博客园 首页 新随笔 联系 订阅 管理

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'
posted on 2017-09-20 23:48  xxxxxxxx1x2xxxxxxx  阅读(1080)  评论(0)    收藏  举报