Q. Why is Boolean considered a sub-type of integers?


Answer :-

Boolean values True and False internally map to integers 1 and 0. That is, internally True is considered equal to 1 and False as equal to 0 (zero). When 1 and 0 are converted to Boolean through bool() function, they return True and False. That is why Boolean's are treated as a sub-type of integers.

Post a Comment

You can help us by Clicking on ads. ^_^
Please do not send spam comment : )

Previous Post Next Post