I was trying to replicate the strcmp from c in python.I typed the former program and it worked but the latter seems to work as well?please explain the latter one.I only expected
Former one just compares the length of two strings. But latter one try to find which one is bigger. For instance:
A = "abcdef" B = "b"
len(A) > len(B) will be true But B > A will be true, because "b" > "a" (which is the first letter of A)