Quiz 2 python certifcation module question no. 8

What will be the output of the following:

a = (1,2,3)

b = (1,2,3)

print(a is b)

  • Option Checked Icon

TrueIncorrect Option

  • FalseCorrect Option
  • Error
    answer should be true because the data type is tuple which is immutable datatype thats why memory utilization is possible but the quiz is showing the answer as false
1 Like

Hi
It should be false because the output of the code will be False . This is because the is operator checks if two variables reference the same object in memory, and in this case, a and b are two separate tuple objects with the same values (1, 2, 3) , but they are not the same object in memory.