check if string ends with python