All jobs / Backend developer / Backend Languages

Backend developer interview question · 0–1 years

What is the difference between == and is?

The strongest answer

== asks whether two values are equal; is asks whether they are the very same object — use is only for None, True, False and sentinels

Why it works

Exactly. Identity versus equality, and is belongs to singletons.

What a good answer covers

Answers that fall short

Who gets asked this

More Backend Languages questions