Notes
Notes copied to clipboard
py的"列表生成式"语法
c = [i*2 for i in [3,21,67]]
print(c)
# [6, 42, 134]
"[]"里分2部分,后面的循环决定数组内容的长度, 前面是数组每一位的内容.