Create all possible combination from a list without any package

suppose I have a list in python that is


how do I get all the possible 2 combinations that I can have from this list in tuples; output example:

[ {hello,hello},{hello,yo},{hello,great},....... {yo,hello},{yo,yo}] 

and so on

no packages allowed

Read more here:

Content Attribution

This content was originally published by enquiries saya at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: