As you can see, the following array called routine
has a series of other arrays inside of it.
[['Dumbell Press', 'Chest Press Machine', 'Smith Machine Bench Press', 'Angled Dips'], [], [], [], ['Tricep Kickbacks', 'Overhead Dumbell Extensions'], [], []]
I have tried to copy each item inside this array into a new array. However when i did so i got this output and the following error message.
Bench Press
Inner Chest Push
Smith Machine Bench Press
Cable Crossover
IndexError: list index out of range
Clearly the code works through the first array inside the 2d array, however stops after that.
This is the code used to generate the above error message.
newarray=[]
for x in range(len(routine)-1):
for i in range(len(routine)-1):
temp = routine[x][i]
print (temp)
newarray.append(temp)
Is there a way in which i can join up these arrays so that there is only one array that looks like this.
['Dumbell Press', 'Chest Press Machine', 'Smith Machine Bench Press', 'Angled Dips','Tricep Kickbacks', 'Overhead Dumbell Extensions']