В следующий раз найдите свойства функции. Я пишу пример кода на основе Python документов
array = ["hello", "hi", "example", "to get", "index from array"]
def SearchIndex():
statement = input()
#// Check if input is item on list
if statement in array: print(">>", array.index(statement))
#// Other search if input is part of item in list
else:
part_of = False
for item in array:
if statement in item:
print('>> {0} is part of "{2}" -> {1}'.format(statement, array.index(item), array[array.index(item)]))
#// If founded signal
part_of = True
#// If nout found (signal is false)
if part_of == False: print(f">> {statement} is not on list...")
while 1:
SearchIndex()