Python ProgrammingPython Programming

Check if the string ends with given string or character in Python

txt = "Canada is a great country"

x = txt.endswith("country")

print(x)
Output
True