Python Compare Strings Lexicographically Ordered