CBSE Class 11 : Python Strings 8

Comparison Operators

Pythons standard comparison operatorsi.e. all relational operators (<,>,<=,>=,==,!=) apply to strings also. The comparison using these operators are based on the standard charcter by character comparison rules for unicode (i.e. dictionay order).
examples:
“a”==”a”                    True
“abc”==”abc”          True
“a” != “abc”             True
“A” !=”a”                  True
“Abc” == “abc”       False
“abc”!=”Abc”         True