I typed in this:<br><br><br> 3 l = []<br> 4 <br> 5 for i in range(0,10):<br> 6 l.append(i+1)<br> 7 <br> 8 for i in range(0,10):<br> 9 print ('%s. %s' % (i, l[i]))<br> 10 <br> 11 def paginate_stuff(list, start):<br>
12 pagesize = 2<br> 13 for i in list[start:start+pagesize]:<br> 14 print ('%s. %s' % (i,list[i]))<br> 15 return<br> 16 <br> 17 paginate_stuff(l,0)<br><br>and i get this:<br>0. 1<br>1. 2<br>
2. 3<br>3. 4<br>4. 5<br>5. 6<br>6. 7<br>7. 8<br>8. 9<br>9. 10<br>1. 2<br>2. 3<br><br><br>What are you expecting?<br> <br><div class="gmail_quote"><br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
But I keep losing list[0]<br>
<br>
Im reasonably sure that it has something to do with my for loop, but I<br>
don't understand how<br>
<div><div class="h5">_______________________________________________<br>
Tutor maillist - <a href="mailto:Tutor@python.org">Tutor@python.org</a><br>
To unsubscribe or change subscription options:<br>
<a href="http://mail.python.org/mailman/listinfo/tutor" target="_blank">http://mail.python.org/mailman/listinfo/tutor</a><br>
</div></div></blockquote><br></div><br><br clear="all"><br>-- <br>Joel Goldstick<br><br>