So I have the below dict
dict = {'tma_prot_{}.grnh':[r'$T_n-P_h$'], 'tma_prot_{}.groh':[r'$T_o-P_h$'], 'tma_urea_{}.grcn':[r'$T_c-U_n$'],
'tma_urea_{}.gron':[r'$T_o-U_n$'], 'tma_wat_{}.grco':[r'$T_c-W_o$']}
So instead of tma_prot_0.grnh
I want 0 to be changed to any number eg: tma_prot_2.grnh
this value I get from say l1 = [0, 2, 11]
so when I call
dict["tma_prot_11.grnh"] or dict["tma_prot_2.grnh"]
I should get value of tma_prot_0.grnh
which is
[r'$T_n-P_h$']
I want a generalized dictionary.
My attempt
for i in l1:
for key in dict.keys():
dict["key".format(l1[i])] = dict["key"]