python string compare first n characters