可能重复: Python三元运算符 在一行上放置一个简单的if-then语句
有没有办法在Python中将if/ else语句压缩到一行? 我经常看到各种快捷方式,并怀疑它也适用于此.
if
else
python
python ×1