結果 : check if string ends with newline python