Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Problem with Words when the alhabet is not made of "simple" letters

Why do i get:

sage : W = FiniteWords(['a','b']) sage : [w for w in W.iterate_by_length(2)]

returns as I wish [word: aa, word: ab, word: ba, word: bb]

but

sage : W = FiniteWords(['a1','a2']) sage : [w for w in W.iterate_by_length(2)]

returns [word: a1,a1, word: a1,a2, word: a2,a1, word: a2,a2]

I do not want the commas to appear here, how can I get [word: a1a1, word: a1a2, word: a2a1, word: a2a2] ?

Problem with Words when the alhabet is not made of "simple" letters

Why do i get:

sage : W = FiniteWords(['a','b'])
sage : [w for w in W.iterate_by_length(2)]

W.iterate_by_length(2)]

returns as I wish wish

[word: aa, word: ab, word: ba, word: bb]

bb]

but

sage : W = FiniteWords(['a1','a2'])
sage : [w for w in W.iterate_by_length(2)]W.iterate_by_length(2)]

returns

returns

[word: a1,a1, word: a1,a2, word: a2,a1, word: a2,a2]

a2,a2]

I do not want the commas to appear here, how can I get get

[word: a1a1, word: a1a2, word: a2a1, word: a2a2] ?a2a2]

instead?

Problem with Words when the alhabet is not made of "simple" letters

Why do i get:

sage : sage: W = FiniteWords(['a','b'])
sage : sage: [w for w in W.iterate_by_length(2)]

returns as I wish

[word: aa, word: ab, word: ba, word: bb]

but

sage : sage: W = FiniteWords(['a1','a2'])
sage : sage: [w for w in W.iterate_by_length(2)]

returns

[word: a1,a1, word: a1,a2, word: a2,a1, word: a2,a2]

I do not want the commas to appear here, how can I get

[word: a1a1, word: a1a2, word: a2a1, word: a2a2]

instead?

Problem with Words when the alhabet is not made of "simple" letters

Why do i get:

sage: W = FiniteWords(['a','b'])
sage: [w for w in W.iterate_by_length(2)]

returns as I wish

[word: aa, word: ab, word: ba, word: bb]

but

sage: W = FiniteWords(['a1','a2'])
sage: [w for w in W.iterate_by_length(2)]

returns

[word: a1,a1, word: a1,a2, word: a2,a1, word: a2,a2]

I do not want the commas to appear here, how can I get

[word: a1a1, word: a1a2, word: a2a1, word: a2a2]

instead?