How to preallocate a list in Python 3.4? -
i want create list of 100 elements. how do in python 3.4. tried following.
l = none * [100]
but got following error
typeerror: can't multiply sequence non-int of type 'nonetype'
it works in python 2.x not python 3.4.
i tried l = range[100]
, won't allow me modify elements afterwards.
you thinking of l = [none] * 100
. ּּּּl = none * [100]ּ
not valid in python 2.x nor python 3.x.
Comments
Post a Comment