I have following simple code. Just confused why the second evaluation is True. Could anyone explain to me? So what is exactly the difference between "is" and "=="?
a = float("inf")
print a != float("inf")
print a is not float("inf") # why is this True?
b = 1
print b != 1
print b is not 1
c = int(1)
print c != int(1)
print c != int(1)
Output:
Python 2.7.10 (default, Jul 14 2015, 19:46:27)
[GCC 4.8.2] on linux
False
True
False
False
False
False