📜  python for循环一行 - Python代码示例

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

代码示例2
>>> x = [1, 2, 3, 4, 5]
>>> y = [2*a for a in x if a % 2 == 1]
>>> print(y)
[2, 6, 10]