On Wed, Apr 17, 2013 at 1:37 AM, aaB <mecagonoisic...@gmail.com> wrote: > but when I do: > > for i in rule: > print rule[i]
When you iterate over rule, you don't iterate over the indices, but over the values themselves. Try this: for i in rule: print i Incidentally, "for i in range(rule)" isn't actually going to work; what you would have used is "for i in range(len(rule))". Be careful with that sort of thing; it's usually safest to actually copy and paste from an interactive session, rather than reconstruct manually. Sometimes it's not obvious whether it was a copy/paste problem or the cause of your underlying confusion. ChrisA -- http://mail.python.org/mailman/listinfo/python-list