Why isn't it true?


#1

s1 = "Welcome to Python"
s2 = s1
s3 = “Welcome to Python”

s1 == s2
True

s1 == s3
False (???why is this false??? Don’t they point to the same object?)


#2

=== doesn’t exist within python, == is for comparison or the is keyword (you can check the documentation how it works)

i am unsure how python handles ===, its really uncommon to do this in python


#3

Sorry, do you mean === (3 equal signs) or do you mean == (2 equal signs)?


#4

i think its in my answer?

so === can’t be used (that is 3 equal signs)

for comparison, we can either use == or is keyword. But this is all in my original answer?


#5

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.