Same Object or identical content : List Compare « List « Python






Same Object or identical content

Same Object or identical content

S1 = 'spam'
S2 = 'spam'
print S1 == S2, S1 is S2


S1 = 'a longer string'
S2 = 'a longer string'
print S1 == S2, S1 is S2

           
       








Related examples in the same category

1.List equivalent?, same object?List equivalent?, same object?
2.List: less,equal,greater: tuple of resultsList: less,equal,greater: tuple of results