SyntaxFix
Write A Post
Hire A Developer
Questions
You always need an else in an inline if:
else
a = 1 if b else 0
But an easier way to do it would be a = int(b).
a = int(b)