I am running this piece of very simple code
a = False
print(isinstance(a, int))
Why is Python treating the variable a as an integer and returns the value to be True, when the variable is set as Boolean value
Can anyone help here
I am running this piece of very simple code
a = False
print(isinstance(a, int))
Why is Python treating the variable a as an integer and returns the value to be True, when the variable is set as Boolean value
Can anyone help here
In Python, booleans are a subclass of integers. True == 1
and False == 0
.
See also: