Python Forum
associating members in a list to more than one features
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
associating members in a list to more than one features
#1
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()
Larz60+ write Mar-10-2023, 04:42 PM:
Please post all code, output and errors (it it's entirety) between their respective tags. Refer to BBCode help topic on how to post. Use the "Preview Post" button to make sure the code is presented as you expect before hitting the "Post Reply/Thread" button.
Fixed for you this time, please use BBCode on future posts.

Attached Files

.py   q1.py (Size: 958 bytes / Downloads: 71)
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  HELP: need a Keylogger with those features cocododo 1 1,969 May-03-2019, 12:33 AM
Last Post: micseydel
  How I can fill class members? AlekseyPython 0 1,672 Feb-14-2019, 06:32 AM
Last Post: AlekseyPython
  Using 'Text' features for model theunpossbile 6 3,917 Jul-10-2018, 06:56 PM
Last Post: theunpossbile
  Class Instances overriding class members and attributes. Leaf 7 6,963 Nov-29-2017, 06:08 AM
Last Post: Leaf

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020