It returns True if string endswith given suffix and False if suffix is not same as given.
Syntax: Str.endswith(suffix, start, end)
Suffix=Last element of string or any object you want to match.
Start=Starting index from where you want to start search.
End=Ending index
e.g a is string given below ending with letter ‘e’ .
a=’apple’
a.endswith(‘e’,0,5)
It will match ‘e’ to the last element of given string start from 0 to 5th index. If matches return True otherwise return False.
Output: True
[…] 6.Str.endswith:It returns True or False if specified object matches with suffix in string. […]