trying to achieve the following in a "for loop"
I have several arrays
a1=[a,b,c,d,e]
a2=[f,g,h,i,j]
a3=[k,l,m,n,o]
Using the loop, I hope to achieve new arrays
b1=[a,f,k]
b2=[b,g,l]....
b5=[e,j,o]
This is what I have :
totala=a1,a2,a3
for x in range (0,len(a1)):
print([item[x] for item in totala])
this allows me to output what I want:[a,f,k] [b,g,l]...
However, i'm not entirely clear how to create the new arrays.
Any help would be useful!
Cheers
zip()and store values in adictrather than dynamically creating new variables