python-day3 for语句完整使用
Python for 语句 完整 Day3 使用
2023-09-27 14:22:13 时间
list=[23,45,567,89];
str_num=89;
for item in list:
print("遍历的结果:%g"%item)
if str_num==item:
print("找到要遍历的结果:%g"%str_num)
else:
print("没有找到,下一个循环");
else:
print("执行完毕!!!")
结果:
遍历的结果:23
没有找到,下一个循环
遍历的结果:45
没有找到,下一个循环
遍历的结果:567
没有找到,下一个循环
遍历的结果:89
找到要遍历的结果:89
执行完毕!!!
相关文章
- Python语法基础_02.if、while、for
- 安装PyMysql报错 python setup.py egg_info Check the logs for full command output.
- python扩展库numpy中函数meshgrid()的使用[当你想要两个for循环嵌套处理时,就该想到它]
- 123 python高级 - 互斥锁
- 【Python】读写文件时 编码错误 https://www.cnblogs.com/baijing1/p/9885891.html
- Python for循环内部实现的一个sample
- Python机器学习零基础理解随机森林算法
- 使用 kvlang 的 Python 可视化编程简介
- evo: Python package for the evaluation of odometry and SLAM
- Python——在for循环中更改list值的方法
- python之range()函数、for-in循环和while循环
- Python学习---range/for/break/continue简单使用
- python 访问 网页 获得源码
- python函数之xticks实现时间作为横坐标并按指定间隔显示
- python第十二课——for in循环
- no python application found, check your startup logs for errors
- Python每日一学 10——for循环
- (原)windows8.1上使用opencv for python
- Python实现输入和排序