Stefan Arentz <[EMAIL PROTECTED]> writes: > Is there a better way to do the following? > > attributes = ['foo', 'bar'] > > attributeNames = {} > n = 1 > for attribute in attributes: > attributeNames["AttributeName.%d" % n] = attribute > n = n + 1 > > It works, but I am wondering if there is a more pythonic way to > do this.
Thank you all. The trick was enumerate(), which I did not know yet :-) S. -- http://mail.python.org/mailman/listinfo/python-list