use of index (beginner's question)
rosuav at gmail.com
Thu Apr 28 03:45:08 CEST 2011
On Thu, Apr 28, 2011 at 11:23 AM, Thomas 'PointedEars' Lahn
<PointedEars at web.de> wrote:
> You forgot a comma after the first `]', to separate the list elements.
Whoops! Apologies. It's very confusing when example code has silly
bugs in it! And yes, need to either back down the indices or insert a
shim. Memo, to self: Run the code through IDLE before posting it,
saves people a lot of trouble!
Incidentally, you're allowed to put the comma on the last item too:
lists = [
['pig', 'horse', 'moose'],
['62327', '49123', '79115'],
Often makes for easier maintenance, especially when you append
More information about the Python-list