How do you do arrays

wes weston wweston at att.net
Tue Feb 1 14:25:25 EST 2005


Thomas Bunce wrote:
> I am new at Pyton and I am learning from book not classes
> so please forgive my being slow
> 
> The below does not work I get an Error of  File 
> "Matrix[index] = k
> NameError: name 'iMatrix' is not defined"
> 
> while  index < majorlop1:
>    index = index + 1
>    k = random.choice(listvalues) + 1
>    iMatrix[index] = k
> 
> The book statement of 
>  array(typecode, initializer) does not make sence
> to me how it henerates ore relaes to the org name 
> for the array.
> 
> Thank You
>      Tom

Thomas,
    You can do

 >>> m = [4]
 >>> m
[4]

wes




More information about the Python-list mailing list