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])) 15 return 16 17 paginate_stuff(l,0) and i get this: 0. 1 1. 2 2. 3 3. 4 4. 5 5. 6 6. 7 7. 8 8. 9 9. 10 1. 2 2. 3 What are you expecting? But I keep losing list[0] > > Im reasonably sure that it has something to do with my for loop, but I > don't understand how > _______________________________________________ > Tutor maillist - Tutor@python.org > To unsubscribe or change subscription options: > http://mail.python.org/mailman/listinfo/tutor > -- Joel Goldstick
_______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor