I just learnt about Python singletons today. But when I am trying my code in VS Code, it acts weird. Here's the code I'm trying:
num_1 = 1007
num_2 = 1007
var1 = [i for i in range(250, 260)]
var2 = [i for i in range(250, 260)]
for i, j in zip(var1, var2):
print(i, i is j)
print(num_1 is num_2)
Here's VS Code's terminal output:
250 True
251 True
252 True
253 True
254 True
255 True
256 True
257 False
258 False
259 False
True
num_1 is num_2 is returning True when it should return False. I have tried in my PC's terminal and that is giving the correct output. I don't understand why it's acting differently in VS Code