# -----简化条件语句的两种方法-----
# valt if condition else valf
def test_if(b):
return 'true' if b else 'false'
# condition and valt or valf
def test_if2(b):
return b and 'true' or 'false'
print(test_if(True))
print(test_if2(True))
print(test_if(False))
print(test_if2(False))