-1

What happened? Why the result is not True?

>>>one=1
>>>type(one)
int
>>>one is int
Flase

1 Answers1

0

You have to use the type function in order to test the type of an object with the is operator:

>>> one=1
>>> type(one) is int
True
>>>
blhsing
  • 91,368
  • 6
  • 71
  • 106