python序列中是否包含某个元素
生活随笔
收集整理的這篇文章主要介紹了
python序列中是否包含某个元素
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
http://outofmemory.cn/code-snippet/9098/python-list-contains-with-in-not-in
?
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'轉載于:https://www.cnblogs.com/chulin/p/9982599.html
總結
以上是生活随笔為你收集整理的python序列中是否包含某个元素的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 转:Linux设备驱动开发(1):内核基
- 下一篇: python日志,支持彩色打印和文件大小