Skip to main content
Journey Uncommon Logo
JourneyUncommon
hardPythoninterningSingle-choice MCQ

Which of these `is` comparisons is guaranteed `True` by CPython's interning behavior, assuming a fresh interpreter and that each pair is evaluated as written?

a = "hello"; b = "hello" # (1) x = "hi"; y = x + " there"; z = "hi there" # (2) p = input(); q = "hello" # (3) p typed as hello m = ("x y", "x y") # (4) m[0] is m[1]