String startswith() and endswith()
String startswith() and endswith(): Python provides the built-in methods startswith() and endswith() for string manipulation. The startswith() and endswith() methods check if the string starts or ends with the given substring. You can also specify where your search should begin on a string. startswith(): The startswith() method checks if the …