一行代碼輸出 1-100 之間的全部偶數

# 方法1 print([i for i in range(1, 101) if i & 0x1 == 0]) # 方法2:測試發現方法二效率更高 print(list(range(2, 101, 2)))
相關文章
相關標籤/搜索