I just learned the story behind python and boolean values representing 'int' values. So when I use the isinstance() I was expecting to receive True // False but this is what returned:
i = 3
x = 0
print(isinstance(i, bool)) <-- expecting True
print(isinstance(x, bool)) <-- expecting False
# what returned
False
False
can someone explain why? and then explain how it works in this function:
def move_zeros(arr):
l = [i for i in arr if isinstance(i, bool) or i!=0]
return l+[0]*(len(arr)-len(l))