Python 查看list中是否含有某元素的方法
作者:Recar 时间:2023-07-29 21:46:08
用关键字 in 和not in 来
如下:
qwe =[1,2,3,4,5]
if 2 in qwe:
print ‘good!'
else:
print ‘not good'
来源:https://blog.csdn.net/qq_28295425/article/details/52444226
标签:Python,list,某元素
![](/images/zang.png)
![](/images/jiucuo.png)
猜你喜欢
Oracle数据安全面面观
2024-01-20 02:12:38
CSS资料中常见英语词语翻译整理
2008-08-29 12:50:00
Python自动安装第三方库的小技巧(pip使用详解)
2021-07-15 19:32:48
![](https://img.aspxhome.com/file/2023/0/131730_0s.jpg)
javascript 得到变量类型的函数
2024-04-30 08:53:34
老生常谈Session和Cookie之间区别与联系(必看篇)
2023-03-09 20:53:24
成为一个顶级设计师的第二准则
2008-04-01 09:41:00
![](https://img.aspxhome.com/file/UploadPic/20084/1/20084194438506s.jpg)
Python光学仿真教程实现光线追踪
2023-08-12 00:27:39
![](https://img.aspxhome.com/file/2023/1/64701_0s.png)
设计从"心"开始
2011-05-21 08:37:00
python获取mp3文件信息的方法
2023-12-18 19:49:11
Python使用BeautifulSoup4修改网页内容的实战记录
2023-04-10 15:59:56
JavaScript常用本地对象小结
2024-06-18 09:23:44
解决Mac下使用python的坑
2021-02-26 21:47:38
YUI Compressor快速使用指南
2011-06-27 20:07:30
python中正则表达式的使用详解
2023-08-08 14:47:13
![](https://img.aspxhome.com/file/2023/5/62285_0s.png)
MySQL数据库事务隔离级别介绍(Transaction Isolation Level)
2024-01-18 05:54:11
![](https://img.aspxhome.com/file/2023/0/116760_0s.jpg)
python如何实现API的调用详解
2023-12-26 18:24:07
![](https://img.aspxhome.com/file/2023/6/133416_0s.png)
Python 中的 global 标识对变量作用域的影响
2021-11-24 00:16:47
详解python 3.6 安装json 模块(simplejson)
2023-08-04 10:55:03
Java数据库连接池之c3p0简介_动力节点Java学院整理
2024-01-19 18:16:03
![](https://img.aspxhome.com/file/2023/7/88167_0s.jpg)
详解PHP的引用计数
2023-11-14 18:00:34