📜  列表理解迭代 - Python 代码示例

📅  最后修改于: 2022-03-11 14:46:32.905000             🧑  作者: Mango

代码示例1
xx = [ (i,j) for i in range(1,6) for j in range(1,4) ]
print(xx)

# output
# [
#  (1, 1), (1, 2), (1, 3),
#  (2, 1), (2, 2), (2, 3),
#  (3, 1), (3, 2), (3, 3),
#  (4, 1), (4, 2), (4, 3),
#  (5, 1), (5, 2), (5, 3)
# ]