You can use a ternary expression in Python, but only for expressions, not for statements: >>> a = "Hello" if foo() else "Goodbye".
確定! 回上一頁