1

Suppose on the following example:

a='a'

while multiplying by an integer both a*2 and 'a' *2 yields same result

>>a*2
'aa'
>>'a' *2 
'aa'

however this does not hold same for comparing:

>>a*2 is 'aa'
False
>>'a' * 2 is 'aa'
True
>> a*2 is 'a' *2
False
Austin
  • 25,142
  • 4
  • 21
  • 46
Bibek Ghimire
  • 512
  • 1
  • 4
  • 19

0 Answers0