Hi all,
I'm learning the basics of Python (and programming). I'm aware that Numpy exists and I eventually will (have to) use it, but I don't want to right now.
Case:
I have a 3 x 3 x 3 array.
I have 27 complex arrays generated, however for purpose sake:
a1=[1], a2=[2] ... a26=[26], a27=[27].
I want to insert these 27 arrays so that
array[0][0][0]=a1
array[0][0][1]=a2
.
.
.
array[2][2][1]=a26
array[2][2][2]=a27
I know how to do this with iteration, but I want to explore and do this via recursion. So 2 questions:
1. How do I solve this case with recursion?
2. How do I limit the number of recursion within recursions when using bigger dimensional arrays? So that PyCharm doesn't crash.
Thank you,
ColdDeath
I'm learning the basics of Python (and programming). I'm aware that Numpy exists and I eventually will (have to) use it, but I don't want to right now.
Case:
I have a 3 x 3 x 3 array.
I have 27 complex arrays generated, however for purpose sake:
a1=[1], a2=[2] ... a26=[26], a27=[27].
I want to insert these 27 arrays so that
array[0][0][0]=a1
array[0][0][1]=a2
.
.
.
array[2][2][1]=a26
array[2][2][2]=a27
I know how to do this with iteration, but I want to explore and do this via recursion. So 2 questions:
1. How do I solve this case with recursion?
2. How do I limit the number of recursion within recursions when using bigger dimensional arrays? So that PyCharm doesn't crash.
Thank you,
ColdDeath