โ† Python
#3 most askedVery commonEasyData types & mutability

is vs ==

๐Ÿข Asked in real interviews
No reports yet. Were you asked this? Be the first to say where.
I was asked this

What's the difference between is and ==? Predict the output.

๐Ÿ”ฎ Predict the output

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

๐ŸŽค Answer it out loud, then check yourself

Say your answer as if the interviewer is listening (30โ€“90 seconds). Then reveal what a strong answer covers and tick what you said.

    Answer out loud first, then compare.
    Want to rehearse it?
    Answer this to the AI interviewer and get a verdict โ†’