Apr-30-2017, 07:49 PM
Could not resist the temptation
![Idea Idea](https://python-forum.io/images/smilies/lightbulb.png)
In [2]: word_set = set('abcde') In [3]: two_letter = [left + right for right in word_set for left in word_set - set([right])] In [4]: print(two_letter) ['ec', 'dc', 'ac', 'bc', 'ce', 'de', 'ae', 'be', 'cd', 'ed', 'ad', 'bd', 'ca', 'ea', 'da', 'ba', 'cb', 'eb', 'db', 'ab']
Test everything in a Python shell (iPython, Azure Notebook, etc.)
- Someone gave you an advice you liked? Test it - maybe the advice was actually bad.
- Someone gave you an advice you think is bad? Test it before arguing - maybe it was good.
- You posted a claim that something you did not test works? Be prepared to eat your hat.