SyntaxFix
Write A Post
Hire A Developer
Questions
Since 2.5 you can use equivalent of Cās ā?:ā ternary conditional operator and the syntax is:
[on_true] if [expression] else [on_false]
So your example is fine, but you've to simply add else, like:
else
print a if b else ''