1. 程式人生 > 其它 >轉載:python檢查某一個元素是否在list

轉載:python檢查某一個元素是否在list

技術標籤:python

轉載:感謝大佬博主文章傳送門

theList = [‘a’,’b’,’c’] 
if ‘a’ in theList: 
print ‘a in the listif ‘d’ not in theList: 
print ‘d is not in the list

在這裡插入圖片描述