SyntaxFix
Write A Post
Hire A Developer
Questions
Use int() on a boolean test:
int()
x = int(x == 'true')
int() turns the boolean into 1 or 0. Note that any value not equal to 'true' will result in 0 being returned.
1
0
'true'