You can use the max
function and a key. Have a look at python max function using ‘key’ and lambda expression.
max(set(lst), key=lst.count)
You can use the max
function and a key. Have a look at python max function using ‘key’ and lambda expression.
max(set(lst), key=lst.count)