嵌套for循环
a = [1, 2, 3]
b = [4, 5, 6]
for i in a:
print(i)
print('----')
for j in b:
print(i + j)
print('========')
print(i, j)
1
----
5
========
6
========
7
========
2
----
6
========
7
========
8
========
3
----
7
========
8
========
9
========
3 6
Process finished with exit code 0
最后
以上就是精明手机最近收集整理的关于Python嵌套for循环的全部内容,更多相关Python嵌套for循环内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复