[Tutor] Arrays and tuples

alan.gauld@bt.com alan.gauld@bt.com
Mon Jan 27 13:04:24 2003


> I want to now put my 3 integer values into an array but it will not let me
do
>
> data[0] = int(x2string)
> data[1] = int(y2string).... etc

data = []   # create empty list

data.append(int(x2string))
data.append(int(y2string))
etc...

> Can you create an array that you can append values to it. 

Exactly so, as shown above.

You might find my Raw Materials chapter useful in the web tutor...

Alan g.
Author of the Learn to Program website
http://www.freenetpages.co.uk/hp/alan.gauld/