Re: [Tutor] Why is my list index going out of range

2013-04-23 Thread Alan Gauld
On 23/04/13 02:47, Jim Mooney wrote: Okay, what am I doing wrong here? primeList = [1] numList = list(range(2,101)) for e in numList: for f in primeList: if numList[e] % primeList[f] != 0: #list index out of range for lops in Python do not generate indexes they return the actual ent

Re: [Tutor] Why is my list index going out of range

2013-04-22 Thread Dave Angel
On 04/22/2013 09:47 PM, Jim Mooney wrote: Okay, what am I doing wrong here? I'm generating primes from a list and getting "list index out of range," but since the for loops controls the indexes I don't see how that's happening. I thought it was the list append, but I commented that out and put in

Re: [Tutor] Why is my list index going out of range

2013-04-22 Thread Mitya Sirenef
On 04/22/2013 09:47 PM, Jim Mooney wrote: Okay, what am I doing wrong here? I'm generating primes from a list and getting "list index out of range," but since the for loops controls the indexes I don't see how that's happening. I thought it was the list append, but I commented that out and put in

[Tutor] Why is my list index going out of range

2013-04-22 Thread Jim Mooney
Okay, what am I doing wrong here? I'm generating primes from a list and getting "list index out of range," but since the for loops controls the indexes I don't see how that's happening. I thought it was the list append, but I commented that out and put in a print statement, and I still got the line