转载:python检查某一个元素是否在list

转载:感谢大佬博主文章传送门

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

在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/weixin_41529093/article/details/112598325