Kent Johnson wrote: > Bryan Fodness wrote: >> Thank you. This works well. I am still trying to figure out the pros >> and cons of using an array, dictionary or list. > > Array is specialized, you probably want list or dict. > > Use list when you want a sequence of items indexed by sequential integers. > Lists > - preserve order > - are fast for indexed lookup > - are relatively slow (O(n)) for adding, deleting and searching (though > for small lists this should not be a consideration)
Are you sure they take O(n) for adding? I would have thought it would take O(1). _______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor