View Single Post
Old 03-24-2004, 07:01 PM   #2 (permalink)
bdl
Senior Contributor
 
Join Date: May 2002
Location: vta.ca.usa
Posts: 555
bdl is on a distinguished road
Nice job. From what I can gather from a little reading I've been doing on Python, a list appears to be analogous to what would be referred to as a 'numerically indexed array' where a dictionary is basically an 'associative index array'. About the only thing I would add is an example of how to loop through a list like so:
Code:
>>> mylist = ['one', 'two', 'three']
>>> for x in range(len(mylist))
...  print mylist[x],
...
one two three
Are there any other usefull methods for iterating through a list aside from a simple for loop?
bdl is offline   Reply With Quote