使用 值 if 条件 else 另一个值 可简化语法形式

 

 


value = 1 if flag else 0

 

posted @ 2021-10-01 13:32  CodeYaSuo  阅读(41)  评论(0编辑  收藏  举报