def invert_actor_dict(actor_dict):
    movie_dict = {}
for key, value in actor_dict.items():
    for actor in value:
        split_movie_name = key.split()
movie_name = ' '.join(split_movie_name)
if actor in movie_dict:
    movie_dict[actor].append(movie_name)
else:
    movie_dict[actor] = [movie_name]
return movie_dict
инвертирующий словарь в python