Problems retrieving items from a list using a reference rather than an integer - can you help?

Mike Rovner mike at nospam.com
Wed Jul 16 18:41:33 EDT 2003


Rogue9 wrote:

> b1 = someOtherList[draw-1]
> r1 = b1[draw]

> Can anyone enlighten me as to why and how to get over this please?

Make sure your someOtherList ALWAYS contains valid indexes for b1, i.e. in
range(len(b1))

[side node] The whole approach seems rather unintuitive to me.

Mike








More information about the Python-list mailing list