I am new to python and am struggling to figure out how to initialize an array of unicode chars to a certain size. I want to use arrays not lists as I desire O(1) random access and O(1) amortized cost for insertion. So far I have this:
from arrays import *
a = array('u')
but obviously this is a zero length array.
Thanks,
Aly
This creates a new array initialized to
"unicode string".If you only want it initialized to a certain size, you can do this:
This will initialize a unicode character array with size
sizeinitialized to null characters.