Automatic dictionary generation - Python
I am trying to create a program which outputs all permutations of a string of length *n* whilst avoiding a defined substring, of length *k*. For example:

Derive all possible strings, up to a length of 5 characters, that can be generated from an initial empty set, which can either go to A or B, but the string cannot contain the substring "AAB" which is not allowed.

i.e. base case of [""] is the empty set.
The dictionary would be - A:{A}, B:{A,B}

From the empty set we can go to A, and we can go to B. We can not go to a B after an A but we can go to an A after a B. And both A and B can access themselves 

example output: a,b,aa,bb,ba,aaa,bbb,baa,bba ... etc

How would I go about prompting a user to define a substring to avoid, and from that generate a dictionary which abides to these rules?

Any help or clarification would be greatly recieved.

Regards,
rkhad

Automatic dictionary generation - Python
===

I am trying to create a program which outputs all permutations of a string of length *n* whilst avoiding a defined substring, of length *k*. For example:

Derive all possible strings, up to a length of 5 characters, that can be generated from an initial empty set, which can either go to A or B, but the string cannot contain the substring "AAB" which is not allowed.

i.e. base case of [""] is the empty set.
The dictionary would be - A:{A}, B:{A,B}

From the empty set we can go to A, and we can go to B. We can not go to a B after an A but we can go to an A after a B. And both A and B can access themselves 

example output: a,b,aa,bb,ba,aaa,bbb,baa,bba ... etc

How would I go about prompting a user to define a substring to avoid, and from that generate a dictionary which abides to these rules?

Any help or clarification would be greatly recieved.

Regards,
rkhad
