Python Forum
Dynamic Array - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: General Coding Help (https://python-forum.io/forum-8.html)
+--- Thread: Dynamic Array (/thread-8919.html)



Dynamic Array - Lal_John - Mar-13-2018

Hi Team,

I am new to python. I want to know is there any way to generate dynamic key depended array.

For eg: if i am passing a key "1234" to a function, it should return with an array.

Also the function must return the same array whenever the key is "1234"


RE: Dynamic Array - sparkz_alot - Mar-13-2018

What have you tried so far? What sort of output do you expect in the 'array', an example would be helpful.


RE: Dynamic Array - Lal_John - Mar-13-2018

I want to create an array which consist of 64 elements, numbers ranging from 0-15.

Eg [5,3,2,0,8,12,9,15....,2,8,0,14....] 64 Elements.

My goal is to create a function that accept a key of fixed size (for eg 4 digit key "1234") which return an array of size 64 ranging from 0-15.

For Now i have used "random.sample(range(64), 64)" to create a dynamic array of 64 elements, but it is ranging from 0- 63. Also the array returned from the random function always changing in every instance.