Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Dynamic Array
#1
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"
Reply
#2
What have you tried so far? What sort of output do you expect in the 'array', an example would be helpful.
If it ain't broke, I just haven't gotten to it yet.
OS: Windows 10, openSuse 42.3, freeBSD 11, Raspian "Stretch"
Python 3.6.5, IDE: PyCharm 2018 Community Edition
Reply
#3
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.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Help using a dynamic array excel formula with XLWings FXMonkey 2 1,206 Jun-06-2023, 09:46 PM
Last Post: FXMonkey
  multi-dimm array -- dynamic PappaBear 3 2,513 May-03-2019, 03:47 AM
Last Post: buran

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020