python 三元列表解析

[x if x %2==0 else None for x in range(1,8)]

如果只需要if

sunset_cols=[i for i in clean_col_list if ('load' in i or 'rad' in i)]

posted @ 2022-07-28 08:53  笨笨和呆呆  阅读(35)  评论(0)    收藏  举报