Answers for "python how to find the index of a string in a list"

2

python get index of substring in liast

index = [idx for idx, s in enumerate(l) if 'tiger' in s][0]
Posted by: Guest on October-07-2020

Code answers related to "python how to find the index of a string in a list"

Python Answers by Framework

Browse Popular Code Answers by Language