python的三元条件语句

详情请参考:Does Python have a ternary conditional operator?

笔者想要实现类似C++中cond?true_fn:false_fn的语句,python中的类似语法是true_fn if cond else false_fn

你可能感兴趣的:(python)