For better code readability, python offers function string.endswith(string)

Could you replace it?