一行代码输出 1-100 之间的全部偶数

# 方法1 print([i for i in range(1, 101) if i & 0x1 == 0]) # 方法2:测试发现方法二效率更高 print(list(range(2, 101, 2)))
相关文章
相关标签/搜索