Create all possible combination from a list without any package

suppose I have a list in python that is

[hello,yo,great,this,cool,fam]

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: https://stackoverflow.com/questions/64403308/create-all-possible-combination-from-a-list-without-any-package

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: