Good afternoon!
I have the list:
a=[4,3, 1, 2, 3]
and the list:
sub_ind_novo=[96, 7, 97, 23, 18]
And I needed to list the lists getting the result: no97. G1 #When the% is 97 , the match in a is 1 , so just print 1 instead I need the element of sub_ind_new to be printed the number of times of the corresponding element in a. (from here, when it takes values different from 1 to a do not know how to do .. ie the 1st element in a is 4, and the one in sub_ind_new is 96, so should 4 lines of this value appear in the way I write here below in the result example) The remainder should be in this form (result example):
no23. G1
no23. G2
no7. G1
no7. G2
no7. G3
no18. G1
no18. G2
no18. G3
no96. G1
no96. G2
no96. G3
no96. G4
And I made the following code but I can not do it for the times where a is different from 1 , ie 2 , 3 , 4 or 5 ) ..
for i in range(0,len(a)):
if a[i]==1:
print ("no%d. G1 \n" %sub_ind_novo[i])
elif:
.....
print ("no%d. G%d \n" %(sub_ind_novo[i],))
Thank you!