829さんじゃありませんが、横レスで関連する質問があります。

https://stackoverflow.com/questions/38417677/why-am-i-getting-a-syntax-error-for-this-conditional-statement

You're getting the SyntaxError because you're using a conditional expression without supplying the else clause which is mandatory.

The grammar for conditional expressions (i.e if statements in an expression form) always includes an else clause:

と書かれていますが、lambda文以外の普通のif statementsの場合、elseがなくても問題がない場合が多々あると思うのですが、
なぜ>>829の例がやこのリンク先の例だとelse以下がないとだめなのでしょうか?