-endswith()is a python string function which check the string ending point and return True and False as per the argument.
Example-
string is s="mytext"
s.endswith("t") will give True
s.endswith("xt") will give True
s.endswith("text") will give True
s.endswith("my") will give False
program-
s="someway"
print("Original string is ",s)
print(s.endswith("y"))
print(s.endswith("Hii"))
print(s.endswith("Y"))
print(s.endswith("way"))
print(s.endswith("someway"))
Original string is someway
True
False
False
True
True