I have a list of words:
words = [\'all\', \'awesome\', \'all\', \'yeah\', \'bye\', \'all\', \'yeah\']
And I want to get a list of tuples:
Is it Pythonic, elegant and efficient?
Looks good to me...
Are you able to do it better?
"better"? If it's understandable, and efficient, isn't that enough?
Maybe look at defaultdict to use that instead of setdefault.