I have a list where the longest word is not a real English word, so I'd like to find the second longest word in my list to make sure it is an English word.
words is the name of my list
I've tried
longest_word = max(words, key=len)-2
longest_word = max(words, key=len)[:-2]
I've even tried
from itertools import groupby
[next(g) for _, g in groupby(sorted(longest_word, key=len), len][-2]
How do I find the second longest word in my list?