🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← Quiz: References and Copying: all 10 questions

Quiz: References and Copying · Question 2 of 10

What does this print? (code)

What does this print?

x = [1, 2]
y = [1, 2]
print(x == y, x is y)
  1. A.True True
  2. B.False False
  3. C.True False
  4. D.False True
Answer & explanation

Correct answer: True False

The values are equal, but they are two separate list objects.

Can you get the rest right without peeking?

Take the timed Quiz: References and Copying quiz free. Pass it to earn XP and count towards your certificate.

Start the quiz →