[Tutor] Help on Arrays?

Andrei Kulakov ak@silmarill.org
Fri, 19 Oct 2001 18:13:49 -0400


On Fri, Oct 19, 2001 at 06:03:14PM -0400, Roger G. Lewis wrote:
> Any reference to tutorial/examples on creation and use of *Arrays* in Python
> would be appreciated by this newbie. Have used them in BASIC so concepts are
> understood but details are not. Thanks.
> 
> R. Lewis
> Ottawa, ON. Canada

Sure, did you look at the python.org tutorial? The site also has links to
other tutorials.

Here's a short "crash course":
>>> a = ["dog"]
>>> a.append(2)
>>> a
['dog', 2]
>>> a = a + ["cat", 34]
>>> a
['dog', 2, 'cat', 34]
>>> a[0]
'dog'
>>> a[2]
'cat'
>>> for item in a:
...  print item
... 
dog
2
cat
34

> 
> 
> _______________________________________________
> Tutor maillist  -  Tutor@python.org
> http://mail.python.org/mailman/listinfo/tutor

-- 
Cymbaline: intelligent learning mp3 player - python, linux, console.
get it at: cy.silmarill.org