TypeError: list indices must be integers or slices, not str

actors = [
    {
        'name': "Will Smith",
        'movie': "Pursuit of Happiness"
    },

    {
        'name': "Brad Pitt",
        'movie': "Ocean's 11"
    },
    {
        'name': "Tom Hanks",
        'movie': "Terminal"
    },
    {
        'name': "Leonardo DiCaprio",
        'movie': "Titanic"
    },
    {
        'name': "Robert Downey Jr",
        'movie': "Iron Man"
    },
]

actor_name = input('Enter the actor name to find a movie -   ')
for i in range(len(actors)):
    if actor_name.lower() in actors[i]['name'].lower():
        print('Actor Name: ', actors[i]['name'])
        print('Movie: ', actors[i]['movie'])
        break
else:
    print('Please choose a valid actor')

Here is what the above code is Doing:
1. We have a list of dictionaries, each dictionary has two keys, ‘name’ and ‘movie’.
2. We ask the user to input an actor name.
3. We iterate over the list of dictionaries.
4. We check if the user input is in the ‘name’ key of the dictionary.
5. If the user input is in the ‘name’ key, we print the ‘name’ and ‘movie’ key values of the dictionary.
6. If the user input is not in the ‘name’ key, we print a message saying ‘Please choose a valid actor’.