您的当前位置:首页TernaryOperators

TernaryOperators

2024-12-14 来源:哗拓教育

(if_test_is_false, if_test_is_true)[test]

Example:

fat = True
fitness = ("skinny", "fat")[fat] print("Ali is ", fitness)
# Output: Ali is fat
显示全文