[Tutor] lists, tuples, arrays

John Keck john_keck@hotmail.com
Mon Feb 24 16:39:01 2003


I'm a somewhat experienced programmer (though not necessarily with 
object-oriented code), but I'm having trouble understanding the differences 
between using lists, tuples, and arrays, and maybe vectors.

Unforuntately the online documents I've seen have not been helpful.  Perhaps 
part of my frustration is that so much of how Python operates on these sorts 
of things is so unlike what I'm used to, and I have a perhaps unrealistic 
hope to do with Python what I can do so easily in, say, IDL or C.

First of all, what are the basic differences between these different types?

For example, I'm trying to set all the values of a slice of a list (or 
array) to a particular value.  How do I do that?

Another example: I'm have a list (or array) of vectors.  How do I multiply 
all of them by a scalar?

Another question: what is the difference between range() and arange()?

Thanks in advance for any direction you can provide.

John Keck

_________________________________________________________________
Tired of spam? Get advanced junk mail protection with MSN 8. 
http://join.msn.com/?page=features/junkmail