What will be the output of the following Python program?

a = [1, 2, 3]
b = a
c = [1, 2, 3]
print(a is b, a is c)
                        

Options

  • A. True True
  • B. False True
  • C. True False
  • D. More than one of the above
  • E. None of the above

Correct Answer (Detailed Explanation is Below)

C. True False

Detailed Explanation

The is operator checks object identity. a and b refer to the same object, whereas c is a different list object.