In python, we can’t able to create arrays with fixed length like other programming languages such as C++, JAVA. But, we can achieve them similarly by initializing a list with fixed length.
An empty array with fixed length
The following code is an example for creating an empty array of fixed length in python,
#define some length length=5 #initialize the array with the help "None" keyword fixed_array=[None]*length #None is special python keyword which is NULL
By that statement we have created an empty array of fixed length 5. After this as python lists are dynamic lists we can modify them after creating an empty array. We can even change it’s length by addition or removal of elements. By this we can conclude that creation of empty array of fixed length in python can be achieved.
Thank you reading this post…