I have a list with dictionary as elements. Each dictionary has an entry called type. The type field represents a list. What is the simplest/pythonic way of obtaining the list with the most elements?
programmes_by_type = []
programmes_by_type.append({'type' : [1, 2, 3]})
programmes_by_type.append({'type' : [2, 5]})
programmes_by_type.append({'type' : [3]})
programmes_by_type.append({'type' : [11, 2, 6, 7]})
Given the previous example it should return the [11, 2, 6, 7] list.
1 Answer