Python Forum
associating members in a list to more than one features - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: General Coding Help (https://python-forum.io/forum-8.html)
+--- Thread: associating members in a list to more than one features (/thread-39564.html)



associating members in a list to more than one features - rezagholi - Mar-09-2023

Hi all,
I want to associate a list of 4 members with another list with the same number of members, but each member of the second list has three sub-members. How can I define that in my code?

Output:
model=[model1,model2,model3 ,model4] mat_prop=[mp1,mp2,mp3,mp4] mp1=[name1, E1, Nu1, Dens1] mp2=[name2, E2, Nu2, Dens2]
.

Here is my code. Please let me know how I can change this:

model=[]
for i in range(4): 
    m='model {}'.formate(i+1)
    model.append(m)             
                                          

    E=[E1,E2,E3,E4]
    Nu=[Nu1, Nu2, Nu3, Nu4]
    Den=[d1,d2,d3,d4]
    name=[st,Al,Ni, ci]
mat_prop=[]
    for i in range (4):
        mat_name=(name[i])
        mat_Elas=(E[i], Nu[i])
        mat_dens=(Den[i])
        mat_prop.append()