You could pass reverse=True to sorted() instead of reversed(), and since it returns a list that list() is probably superfluous