For Excel use, I want to create a code that represents A1, A2,...D1, ... AB1, AB2, ...
field = [A, B, C, ..., AA, AB, ..., YZ, ZZ]
data = [[1, 2,3,4,5], [2, 3,4,5,6], [3, 5,4,3,5], [4, 5,6,7,7],...] #[index, data1, data2,...]
for i in field: # A, B, C, ...
for j in range(0,10): # First index in data
for k in range(1,4):
print(str(i)+data[j][k])
The result I want is A2 A3 A4 A5 B3 B4 B5 B6 C5 C4 C3 C5 ...
I think I need to use a break statement, but how do I do that?
fieldwith the corresponding sub-list fromdatafirst (before iterating over the sub-list to make your outputs). But these nested loops mean to use every element ofdata, for each element offield(i.e. for 10 fields and 10 data sublists, you get 100 results instead of 10). Solving this is called iterating in parallel. Please see the linked duplicate to understand how to do it.