Ordered list question

Chris Angelico rosuav at gmail.com
Sun Jul 17 18:38:01 CEST 2011

On Mon, Jul 18, 2011 at 2:28 AM,  <jyoung79 at kc.rr.com> wrote:
> My question is, does python have a similar way to do something like this?
> I'm assuming the best way is to create a dictionary and then sort it by
> the keys?

That would be one way to do it. If you know beforehand what the
highest ID is, you could create a list and treat it exactly the way
you're treating the Javascript array, but I think the dictionary is
probably a better option.

Chris Angelico

More information about the Python-list mailing list