Answers for "finding index of a given string in list in python"

0

python get index of substring in liast

def index_containing_substring(the_list, substring):
    for i, s in enumerate(the_list):
        if substring in s:
              return i
    return -1
Posted by: Guest on October-07-2020

Code answers related to "finding index of a given string in list in python"

Python Answers by Framework

Browse Popular Code Answers by Language