可能重复:
Python 中的三元条件运算符
我有这个问题,不知道问谷歌这个:
(value == 'ok') ? 'ok' : 'not ok'
我的意思是语法:
(expression) ? (return if <expresion> is true) : (return this value if <expresion> is false
可能重复:
Python 中的三元条件运算符
我有这个问题,不知道问谷歌这个:
(value == 'ok') ? 'ok' : 'not ok'
我的意思是语法:
(expression) ? (return if <expresion> is true) : (return this value if <expresion> is false