QuestenaPráctica que te muestra qué repasar después
Pregunta 52

Spot the accurate distinction between `a == b` and `a is b` in Python comparisons.

  1. Both operators always perform the same test.
  2. Identity converts both operands before comparing values.
  3. Equality compares values; identity tests whether the object is the same.Respuesta correcta
  4. Equality checks memory location; identity compares converted values.

Explicación

Equality delegates to value-comparison semantics, whereas identity asks whether both references designate one object. Treating `is` as a stricter value conversion obscures that it answers a different question rather than applying a stronger equality rule.

Continúa con este test

Empezar la práctica
Pregunta 52: Spot the accurate distinction between `a == b` and `a is b`… · Python Fundamentals · Questena