Read `help('is')`: The operators "is" and "is not" test for an object’s identity: "x is
y" is true if and only if *x* and *y* are the same object. An
Object’s identity is determined using the "id()" function. "x is not
y" yields the inverse truth value.
– CorralienSep 27 '21 at 12:43
1
The above is slightly different in that you did not explicitly use `==` but it's the same point of confusion. It has nothing to do with string multiplication in this case. The second case might work for a number of reasons (e.g. constant folding optimization)
– IguananautSep 27 '21 at 12:44
@Iguananaut, yes, python optimization mechanism, I think this is what I need. Thanks
– Artur BSep 27 '21 at 13:03