Question: Find the first To answer this question, search through Python documentation of str for methods that could be useful in your solution. Do not use

Find the first

To answer this question, search through Python documentation of str for methods that could be useful in your solution. Do not use loops. Complete the function below according to its docstring description.

def find_first_occurrence(msg: str, string_to_find: str) -> int:

"""Return the index of the first occurence of string_to_find

in msg, or -1 if it does not occur, ignoring case.

>>> find_first_occurrence('October holidays: Halloween and Thanksgiving', 'H')

8

>>> find_first_occurrence('Because DEC 25 == OCT 31', 'H')

-1

>>> find_first_occurrence('hip hip hooray', 'ip')

1

"""

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!