On Mar 27, 8:15 am, Grimsqueaker <[EMAIL PROTECTED]> wrote:
> Hi, I'm fairly new to Python and to this list. I have a problem that
> is driving me insane, sorry if it seems simple to everyone, I've been
> fighting with it for a while. :))
>
> I want to take a variable length string and use it as a
Grimsqueaker <[EMAIL PROTECTED]> writes:
> Basically I want to find every possible order of every combination.
> Its easy if you know how many characters there will be in your string
> (use nested for loops), but I am stuck with the variable length
> string. I think I have to use a generator but I'
On Mar 31, 8:18 pm, "Gabriel Genellina" <[EMAIL PROTECTED]>
wrote:
> En Mon, 31 Mar 2008 09:30:00 -0300, Graeme Glass <[EMAIL PROTECTED]>
> escribió:
>
> > On Mar 27, 11:01 am, Peter Otten <[EMAIL PROTECTED]> wrote:
> >> a b c aa ab ac ba bb bc ca cb cc aaa aab aac aba abb abc aca acb acc
> >> baa
En Mon, 31 Mar 2008 09:30:00 -0300, Graeme Glass <[EMAIL PROTECTED]>
escribió:
> On Mar 27, 11:01 am, Peter Otten <[EMAIL PROTECTED]> wrote:
>> a b c aa ab ac ba bb bc ca cb cc aaa aab aac aba abb abc aca acb acc
>> baa bab
>> bac bba bbb bbc bca bcb bcc
>
> Here is a cool solution we came up
On Mar 27, 11:01 am, Peter Otten <[EMAIL PROTECTED]> wrote:
> Grimsqueaker wrote:
> > That seems to give me the items in the list back in an iterator. Am I
> > using it incorrectly?
>
> With Dan's functions in cartesian.py you can do the following:
>
> >>> from cartesian import *
> >>> def count(di
On Mar 27, 4:01 am, Peter Otten <[EMAIL PROTECTED]> wrote:
> Grimsqueaker wrote:
> > That seems to give me the items in the list back in an iterator. Am I
> > using it incorrectly?
>
> With Dan's functions in cartesian.py you can do the following:
>
> >>> from cartesian import *
> >>> def count(dig
Grimsqueaker wrote:
> That seems to give me the items in the list back in an iterator. Am I
> using it incorrectly?
With Dan's functions in cartesian.py you can do the following:
>>> from cartesian import *
>>> def count(digits):
... args = []
... while 1:
... args.append(di
OK, got that. If I use:
for x in string_cartesian_product('abc'):
print x
I get:
a
b
c
What am I not understanding?
Thank you
--
http://mail.python.org/mailman/listinfo/python-list
On Thu, 27 Mar 2008 00:33:21 -0700, Grimsqueaker wrote:
> That seems to give me the items in the list back in an iterator. Am I
> using it incorrectly?
Given an iterator, you use it like this:
for item in iterator:
print item # or do something else
If you're sure that the iterator is relat
Grimsqueaker schrieb:
> That seems to give me the items in the list back in an iterator. Am I
> using it incorrectly?
No. Just put a list() around it.
Diez
--
http://mail.python.org/mailman/listinfo/python-list
On Mar 27, 2:33 am, Grimsqueaker <[EMAIL PROTECTED]> wrote:
> That seems to give me the items in the list back in an iterator. Am I
> using it incorrectly?
Use list( it ).
--
http://mail.python.org/mailman/listinfo/python-list
That seems to give me the items in the list back in an iterator. Am I
using it incorrectly?
--
http://mail.python.org/mailman/listinfo/python-list
On Mar 27, 1:15 am, Grimsqueaker <[EMAIL PROTECTED]> wrote:
> Hi, I'm fairly new to Python and to this list. I have a problem that
> is driving me insane, sorry if it seems simple to everyone, I've been
> fighting with it for a while. :))
>
> I want to take a variable length string and use it as a
13 matches
Mail list logo