how to check position of character in a string python