Sunday, November 28, 2010

python: lists

to use data structures
list
http://docs.python.org/tutorial/introduction.html#lists
a = [1, 3,4,2]
names = ['BY', 'jon']
#access individual items
eg.: a[2]
cannot use index beyond list range
so gotta use
methods: append, insert
(http://docs.python.org/tutorial/datastructures.html)
eg.: a.append(1000)
to find size of list: len(a)

No comments: