summer506hai / Study-Notes

学习记录合辑
0 stars 0 forks source link

读《python一行流》 #8

Open summer506hai opened 1 year ago

summer506hai commented 1 year ago

列表


print([x * 2 for x in range(10)])

print([x ** 2 for x in range(10) if x % 2 == 0])# 【0-9】中,偶数的平方