lexicographically compare strings python