On Sunday, January 2, 2011 3:36:35 PM UTC, T wrote: > The grouper-way looks nice, but I tried it and it didn't work: > > from itertools import * > ... > d = dict(grouper(2, l)) > > NameError: name 'grouper' is not defined > > I use Python 2.7. Should it work with this version?
No. As Ian said grouper() is a receipe in the itertools documentation. http://docs.python.org/library/itertools.html#recipes The module doesn't provide it directly -- http://mail.python.org/mailman/listinfo/python-list