Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #19986 > unrolled thread
| Started by | Chris Angelico <rosuav@gmail.com> |
|---|---|
| First post | 2012-02-08 08:37 +1100 |
| Last post | 2012-02-08 08:37 +1100 |
| Articles | 1 — 1 participant |
Back to article view | Back to comp.lang.python
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: iterating over list with one mising value Chris Angelico <rosuav@gmail.com> - 2012-02-08 08:37 +1100
| From | Chris Angelico <rosuav@gmail.com> |
|---|---|
| Date | 2012-02-08 08:37 +1100 |
| Subject | Re: iterating over list with one mising value |
| Message-ID | <mailman.5517.1328650642.27778.python-list@python.org> |
On Wed, Feb 8, 2012 at 8:25 AM, Aaron France <a.france.mailinglists@gmail.com> wrote: > for i in range(0, len(x), 2): > print x[i-1], x[i] I think you want x[i], x[i+1] here, but in any case, this is a fairly standard non-Python way to do this sort of thing. There's a variety of more Pythonic ways to loop, but every now and then, the old C habits still come in handy! ChrisA
Back to top | Article view | comp.lang.python
csiph-web