Question

Complete the Python function to find the starting index of the first occurrence of sub in main_string. Return -1 if not found. def find_substring_index(main_string, sub):     _________ # Line to complete

A return main_string.find(sub)
B return main_string.index(sub)
C return main_string.search(sub)
D return main_string.locate(sub)
E return main_string.contains(sub)
Practice Next

Hey! Ask a query