Python basics, data type issues
phpcn_u1582
phpcn_u1582 2017-05-18 10:46:27
0
2
901
print type(-10)=="int"

Why does the above code return False?

type(-10) is integer data.

phpcn_u1582
phpcn_u1582

reply all(2)
黄舟

print(type(10) == int)
True

If you add double quotes to int, it becomes str, which is of course different from int.

大家讲道理

That’s not how it works. . .

type(-10) is int
isinstance(-10,int)
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template