Name
array
Synopsis
array(typecode,init='')
Creates and returns an array object
a with the given
typecode. init
can be a plain string whose length is a multiple of
itemsize; the string’s bytes,
interpreted as machine values, directly initialize
a’s items. Alternatively,
init can be a list (of characters when
typecode is 'c',
otherwise of numbers): each item of the list initializes one item of
a.
Array
objects expose all the methods and operations of mutable sequences,
as covered in Chapter 4, except method
sort. Concatenation (with both
+ and extend) and assignment to
slices require both operands to be arrays with the same type code
(i.e., there is no implicit coercion between sequences). In addition
to the methods of mutable sequences, an array
object a also exposes the following
methods.