Use:
>>> bool(1)
True
>>> bool(0)
False
>>> int(bool(1))
1
>>> int(bool(0))
0
Can convert back too.
Or a clever hack that could be quicker would be:
>>> not not 1
True
>>> not not 0
False
>>>
Converting back:
>>> int(not not 1)
1
>>> int(not not 0)
0
>>>