Post

@Python_Dv The right answer is B, because join() method creates the string "hello" which is then assigned to variable b, but "a" and "b" are different ovjects in memory. If I may point a mistake in the picture, a quotation mark lacks before .join method
English

@Python_Dv 1. Is operator checks if variables point to the same object in memory
2. == checks if the 2 variables have same values/elements
3. In python, the join() function creates a new object in memory
4. a is b, FALSE (object have separate memories)
5. a==b, TRUE (same object values)
English

@Python_Dv Correct answer: B — False True
== compares values, is compares object identity.
"hello" is a literal (often interned), while "".join(...) creates a runtime string, same type and value, but different object identity (different instance), i.e. distinct objects in memory.
English







