Hi,
I wanted to see if anyone could help with figuring out if there is a simpler way to code what I have below. What I have below works fine but I wanted to see if there was a simpler way to write the code.
Fields, Grps = ['FieldA','FieldB','FieldC'], ['GroupA','GroupB','GroupC']
Main = [['DOG','CAT','HORSE'], ['HOUSE','BARN'], ['FIELDS', 'YARD'],['MOUSE','SNAKE','LIZARD','OTHER'],['AQUARIUM','GLASS TANK','SMALL CAGE'],
['HOUSE','APARTMENT','PET STORE'],['COW','PIG', 'SHEEP'], ['FIELDS','PASTURES'], ['BARN','FARM HOUSE','OTHER']]
MainDict = dict(zip([chr(i) for i in range(ord('A'),ord('A')+len(Main))], Main))
EstVOrder = [[i for i in [chr(i) for i in range(ord('A')+n,ord('A')+n+len(Fields))]] for n in range(0,len(Main),len(Main)//len(Fields))]
Main = dict(zip(Grps,[[[x,y,z] for x in MainDict[a] for y in MainDict[b] for z in MainDict[c]] for a,b,c in EstVOrder]))
print (Main)
I would also like to know if the code above is properly written.