How does it work in Python?
value='1' booleanValue = (value == '1') print booleanValue 1 value='0' booleanValue = (value == '1') print booleanValue 0
BUT:
value=1 if value: print "bla" bla value=0 if value: print "bla" bla
So there you are, you can make out the rule to convert 0 and 1 into a boolean.
No comments:
Post a Comment