Python 嵌套for循环

2022-05-18 14:07:21 浏览数 (1)

嵌套for循环
  • for循环中的for循环
代码
代码语言:javascript复制
# coding:utf-8

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)

0 人点赞