Problems retrieving items from a list using a reference rather than an integer - can you help?
staschuk at telusplanet.net
Thu Jul 17 04:02:02 CEST 2003
> draw = 1
> while 1:
> if draw == 792:
> b1 = someOtherList[draw-1]
> r1 = b1[draw]
> draw = draw+1
> However,the item I expect is not being retrieved i.e. a zero is the result
> of the retrieval rather than the integer in the list I was expecting.
> Furthermore,when I substitute an integer for draw e.g. r1 = b1,I
> do get the expected result.
Bizarre. What is the value of someOtherList?
(And, as a side note, why not use a for loop, e.g.,
for draw in range(1, 793):
r1 = someOtherList[draw-1][draw]
# and then, I assume, you actually do something with r1
Steven Taschuk staschuk at telusplanet.net
Every public frenzy produces legislation purporting to address it.
More information about the Python-list