Write a function, which would return a list with the strings and their index. e.g. ['good', 'morning'] -> ['0 - good', '1 - morning']
I tried this:
def add_index(list_a):
x = []
for word in list_a:
x = [list_a.index(word) for word in list_a]
return x
However, the return is [0, 1], not what I am looking for.