Re: [Tutor] working with empty lists

2010-09-16 Thread Rance Hall
On Thu, Sep 16, 2010 at 11:21 AM, Joel Goldstick wrote: > > > On Thu, Sep 16, 2010 at 11:46 AM, Rance Hall wrote: >> >> On Thu, Sep 16, 2010 at 9:24 AM, Joel Goldstick >> wrote: > This line is illustrative: > >>  13 for i in list[start:start+pagesize]: > > start is 0, pagesize is 2 so we

Re: [Tutor] working with empty lists

2010-09-16 Thread Joel Goldstick
On Thu, Sep 16, 2010 at 11:46 AM, Rance Hall wrote: > On Thu, Sep 16, 2010 at 9:24 AM, Joel Goldstick > wrote: > > I typed in this: > > > > > > 3 l = [] > > 4 > > 5 for i in range(0,10): > > 6 l.append(i+1) > > 7 > > 8 for i in range(0,10): > > 9 print ('%s. %s' % (i, l[i])

Re: [Tutor] working with empty lists

2010-09-16 Thread Rance Hall
On Thu, Sep 16, 2010 at 9:24 AM, Joel Goldstick wrote: > I typed in this: > > >   3 l = [] >   4 >   5 for i in range(0,10): >   6 l.append(i+1) >   7 >   8 for i in range(0,10): >   9 print ('%s. %s' % (i, l[i])) >  10 >  11 def paginate_stuff(list, start): >  12 pagesize = 2 >  13   

Re: [Tutor] working with empty lists

2010-09-16 Thread Joel Goldstick
I typed in this: 3 l = [] 4 5 for i in range(0,10): 6 l.append(i+1) 7 8 for i in range(0,10): 9 print ('%s. %s' % (i, l[i])) 10 11 def paginate_stuff(list, start): 12 pagesize = 2 13 for i in list[start:start+pagesize]: 14 print ('%s. %s' % (i,list[i]))

Re: [Tutor] working with empty lists

2010-09-16 Thread Rance Hall
On Wed, Sep 15, 2010 at 11:33 PM, bob gailer wrote: >  On 9/16/2010 12:05 AM, Rance Hall wrote: >> Thanks guys for replying, looks like I do have a bug in my code, but its not where I thought it was. Must have been up too late last night. The code I provided in my OP does work (with typos corr

Re: [Tutor] working with empty lists

2010-09-16 Thread Alan Gauld
"Rance Hall" wrote Here is what I've got so far: l = [] for i in range(0,10) l.append(i) for i in range(0,10) print('%s. %s' % (i, l[i]) I tried changing the append to l.append(i+1) which almost worked but the output started with 1. 2 I was curious what happend to the 0. 1 line Yo

Re: [Tutor] working with empty lists

2010-09-16 Thread Timo
On 16-09-10 06:05, Rance Hall wrote: Im working on a little piece of test code to test an idea for a larger script. Here is what I've got so far: l = [] for i in range(0,10) l.append(i) for i in range(0,10) print('%s. %s' % (i, l[i]) This gives me: 0. 0 1. 1 2. 2 etc which

Re: [Tutor] working with empty lists

2010-09-15 Thread bob gailer
On 9/16/2010 12:05 AM, Rance Hall wrote: Im working on a little piece of test code to test an idea for a larger script. Here is what I've got so far: l = [] for i in range(0,10) l.append(i) for i in range(0,10) print('%s. %s' % (i, l[i]) This gives me: 0. 0 1. 1 2. 2 etc w