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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started