#!/usr/bin/python sanat = set(['qeo','imoe','clydile','pza','uadio','aboc','hafr','dun','barai','pechies','l$ yhdistelmat = [] for sana1 in sanat: loputsanat1 = sanat - set([sana1]) for sana2 in sanat: loputsanat2 = loputsanat1 - set([sana2]) for sana3 in sanat: loputsanat3 = loputsanat2 - set([sana3]) for sana4 in sanat: yhdistelmat.append(sana1 + ' ' + sana2 + ' ' + sana3 + ' ' + sana4) for yhdistelma in yhdistelmat: print yhdistelma