I was doing a beginner exercise regarding identity operator "is".
In Python Shell,
Python 3.10.2 (tags/v3.10.2:a58ebcc, Jan 17 2022, 14:12:15) [MSC v.1929 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> a = -5
>>> print(a is -5)
True
>>> a = -6
>>> print(a is -6)
False
And now in VScode
a = -5
print(a is -5)
a = -6
print(a is -6)
c:\Users\Desktop\ppython\practice.py:4:
print(a is -6)
True
True
Cleary the program is processed differently in Python Shell and VScode, but I could not understand why this is the case nor which is "correct". Could someone please explain this?