On Apr 13, 8:16 am, "Jia Lu" <[EMAIL PROTECTED]> wrote: > > for m in test: > > for n in test: > > for o in test: > > for p in test: > > print m+n+o+p > > Thanx for your anwser. > But if I consider about a combination of over 26 letter's list just > like: > "abcdefssdzxcvzxcvzcv" > "asllxcvxcbbedfgdfgdg" > ..... > > Need I write 26 for loops to do this? > > Thanx > > Jia LU Try this: http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/502199
You could then write something like: import string for thiscomb in comb2( *([string.lowercase]*26) ): ... Mind you, it generates a lot of combinations. - Paddy. -- http://mail.python.org/mailman/listinfo/python-list