I have the following list of dictionaries:
[{'title': 'Shrek the Musical', 'year': 2013, 'genres': ['Comedy', 'Family', 'Fantasy'], 'duration': 130, 'directors': ['Michael John Warren'], 'actors': ["Brian d'Arcy James", 'Sutton Foster', 'Christopher Sieber'], 'rating': 7.0},
{'title': 'Shrek Retold', 'year': 2018, 'genres': ['Animation', 'Adventure', 'Comedy'], 'duration': 90, 'directors': ['Grant Duffrin'], 'actors': ['Harry Antonucci', 'Russell Bailey'], 'rating': 7.5},
{'title': 'Shrek 2', 'year': 2004, 'genres': ['Animation', 'Adventure', 'Comedy'], 'duration': 93, 'directors': ['Andrew Adamson', 'Kelly Asbury'], 'actors': ['Mike Myers', 'Eddie Murphy'], 'rating': 7.2},
{'title': 'Shrek the Third', 'year': 2007, 'genres': ['Animation', 'Adventure', 'Comedy'], 'duration': 93, 'directors': ['Chris Miller', 'Raman Hui'], 'actors': ['Mike Myers', 'Eddie Murphy', 'Cameron Diaz', 'Antonio Banderas'], 'rating': 6.1},
{'title': 'Shrek Forever After', 'year': 2010, 'genres': ['Animation', 'Adventure', 'Comedy'], 'duration': 93, 'directors': ['Mike Mitchell'], 'actors': ['Mike Myers', 'Eddie Murphy', 'Cameron Diaz', 'Antonio Banderas'], 'rating': 6.3},
{'title': 'Shrek', 'year': 2001, 'genres': ['Animation', 'Adventure', 'Comedy'], 'duration': 90, 'directors': ['Andrew Adamson', 'Vicky Jenson'], 'actors': ['Mike Myers', 'Eddie Murphy'], 'rating': 7.8}]
I want to produce a list of movies sorted in increasing order of their year of release. That is, the sorting should just depend on one value, ignoring all other keys.
I tried using the sorted function, but I don't know how to specify that the dictionaries should be sorted based on a single value.