<分区> 分区>
有没有可能把下面的写得更简洁一些?
if condition: a = [1, 7, 2] else: a = [1, 7]
我正在寻找一种a = [1, 7, 2 if condition]
a = [1, 7, 2 if condition]