Alphabet et mots [How-To]
Créer la totalité des mots depuis un alphabet donné
>>> def construct(word, alphabet): ... if len(word)<5: ... for x in alphabet: ... print word+x ... construct(word+x,alphabet) ... ... >>> alphabet=['a','b','c'] >>> word='' >>> construct(word, alphabet) a aa aaa aaaa aaaaa aaaab ... ccccc

Log in
PloneArticle
Forgot your password?