1、 for循环嵌套
嵌套循环是循环中的循环。
“内层循环” 将针对 “外层循环” 的每次迭代执行一次:
例如:
打印输出列表元素:
adj = ["red", "big", "tasty"] langs = ["c", "java", "python"] for x in adj: for y in langs: print(x, y)
相关文档:
嵌套循环是循环中的循环。
“内层循环” 将针对 “外层循环” 的每次迭代执行一次:
例如:
打印输出列表元素:
adj = ["red", "big", "tasty"] langs = ["c", "java", "python"] for x in adj: for y in langs: print(x, y)
相关文档: