The endswith() function is used to retrieve whether the string ends with the specified string, and returns
True if it is; otherwise it returns False. The syntax of the method is as follows:
The specific meanings of the parameters in this format are as follows:
str: the original string;
sub: the string to be retrieved;
start: Specifies the index of the starting position at the beginning of the search (the index value
of the first character of the string is 0). If not specified, the search starts from the beginning
end: Specifies the index of the end position of the search. If not specified, the search is
performed until the end by default.
[Example:] Search whether "www.freelearningpoints.com" ends with "com".