Difference in handling of tuples in python shell vs IDLE

Viewed 98

I was learning about python tuples when I encountered a weird inconsistency. This code:

x = (1,2)
y = (1,2)
print(x is y)

This gives False in shell but True in IDLE. Is there a reason for that?

1 Answers

Actually Python IDLE and shell uses different storage system for data types like tuple-() All other data types like :

  • list
  • set
  • dict

are goning to show the same.

Related