This will work, but assumes you don't need case sensitivity:
myList = ["what is your name","Hi, how are you","What about you","How about a coffee","How are you"] duplicate = "how are you" index_list_of_duplicate = [i for i,j in enumerate(myList) if duplicate in j.lower()] print index_list_of_duplicate [1,4]
source share