3 ms·
Sure. `==` should be used for such comparisons, not `is`, as the latter is semantically different. They have the same effect for "apricot" because Python intern
by jacobolus 16y ago
Sure. `==` should be used for such comparisons, not `is`, as the latter is semantically different. They have the same effect for "apricot" because Python interns strings up to length 20:
>>> "1"*20 is "1"*20
True
>>> "1"*21 is "1"*21
False