TernaryOperators

2018-08-22  本文已影响7人  孟轲666

(if_test_is_false, if_test_is_true)[test]

Example:

fat = True
fitness = ("skinny", "fat")[fat] print("Ali is ", fitness)
# Output: Ali is fat
上一篇 下一篇

猜你喜欢

热点阅读