Referred following question -
1) different run results between python3 and python2 for the same code
2) “is” operator behaves unexpectedly with integers
3) Consecutive 'is' operator in Python [duplicate]
5) What does 'is' operator do in Python?
6) Strange python 'is' operator in arithmetic [duplicate]
7) Why does the “is” keyword have a different behavior when there is a dot in the string?
Explanation for not duplicate question - In my question, I have not included any symbol, numeric values. I am including simple string. In above 7th referred question, I already know the reason behind giving different output and I have already read that.
Here, my question is different.
My Question Description -
I am practicing following Python code in 3.6.8 version and using PyCharm editor.
print('a' * 18 is 'aaaaaaaaaaaaaaaaaa')
print('a' * 19 is 'aaaaaaaaaaaaaaaaaaa')
print('a' * 20 is 'aaaaaaaaaaaaaaaaaaaa')
print('a' * 21 is 'aaaaaaaaaaaaaaaaaaaaa')
print('a' * 22 is 'aaaaaaaaaaaaaaaaaaaaaa')
Output =
True
True
True
False
False
Why does 'a' * 21 is 'aaaaaaaaaaaaaaaaaaaaa'
and onwards strings not evaluate to True?
Any help would be appreciated