Python Check If Substring Is At The End Of String