Post

@PythonPr Answer: C. False True
In Python, the is operator checks if two variables refer to the exact same object in memory, while the == operator checks if the objects have the same value.
d1 and d2 are two separate dictionary objects, even though they contain the same key-value
English

@PythonPr Correct answer: C) False True
Why:
d1 is d2 → False because is checks object identity (both are different dictionary objects in memory).
d1 == d2 → True because == checks value equality, and both dictionaries have the same key–value pairs.
English

@PythonPr Answer: C
Solution: The difference between `is` and `==` confuses many.
Key is to understand how names and values work in python.
Think of values as things. Like, say suitcases.
And, names are like label tags put on these suitcases.
The value is the actual "thing" (data)
+
English

@PythonPr C). Two dicts can look identical but still live in different memory locations.
is checks identity → same object? False
== checks equality → same content? True
So the output will be:
False, True
English

@PythonPr False True
d1 is distinct from d2 while the vales are the same (True)
English

@PythonPr the first line prints false and the second prints true
English

@PythonPr False falseじゃないの仕様としてキモすぎだろ。てかこれをtrueにしたいなら、hashCodeとかequalみたいなメソッドはやすべきだろ
日本語










