How to get all the maximums max function
max, python
Solution
You can write this as a list comprehension:
data = ['str', 'frt']
maxlen = max(map(len, data))
result = [s for s in data if len(s) == maxlen]
Problem
``` data = ['str', 'frt'] max(data, key=len) ``` The max function returns only one of the strings. How can I make it return both of the strings? The length of both strings is equal, so `max` should return both the strings but it returns only one so is there a way to return all max items?