Am 04.12.2012 19:28, schrieb DJC: >>>> (i for i,v in enumerate(w) if v.upper() != v).next() > Traceback (most recent call last): > File "<stdin>", line 1, in <module> > AttributeError: 'generator' object has no attribute 'next'
Yeah, i saw this problem right after i sent the posting. It now is supposed to read like this >>> def split_product(p): ... w = p.split(" ") ... j = next(i for i,v in enumerate(w) if v.upper() != v) ... return " ".join(w[:j]), " ".join(w[j:]) Greetings -- http://mail.python.org/mailman/listinfo/python-list