Python 官方文档:入门教程 => 点击学习
# -*- coding:utf-8 -*- # -Author: Paulliam - for i in range(5): print("---------",i) for j in range(10):
# -*- coding:utf-8 -*-
# -Author: Paulliam -
for i in range(5):
print("---------",i)
for j in range(10):
print(j)
if j>5:
break #结束本次循环
##########运行结果:
"D:\Program Files\python-3.6.4\Python.exe" "C:/Users/Administrator/Desktop/python-prj/for double.py"
--------- 0
0
1
2
3
4
5
6
--------- 1
0
1
2
3
4
5
6
--------- 2
0
1
2
3
4
5
6
--------- 3
0
1
2
3
4
5
6
--------- 4
0
1
2
3
4
5
6
Process finished with exit code 0
--结束END--
本文标题: python语法 3.1 双重for循环
本文链接: https://lsjlt.com/news/185377.html(转载时请注明来源链接)
有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341
2024-03-01
2024-03-01
2024-03-01
2024-02-29
2024-02-29
2024-02-29
2024-02-29
2024-02-29
2024-02-29
2024-02-29
回答
回答
回答
回答
回答
回答
回答
回答
回答
回答
0