Jan-13-2018, 10:54 AM
Hello I'm new:), I'm on the realisation of a family tree project, it is 95% complete (approximately 200 lines) But I can't do something that I think is simple.
I currently have a function that has the end of its process returns to me a table of this form, which may be longer in some cases but the syntax is the same:
The function who return me the table of value is it:
I currently have a function that has the end of its process returns to me a table of this form, which may be longer in some cases but the syntax is the same:
[0, 1]I have a list of people that is built as the user's choices of the form grow:
liste = [[' NAME1',' SURNAME1'],[' NAME2',' SURNAME2'],[' NAME3',' SURNAME3']]I would like from the value table[0,1], it returns to me the first name of the corresponding person in the list of persons SURNAME
The function who return me the table of value is it:
def descendants(num3): descendants = [] for i in range(len(listeparentes)): if (num3 == listeparentes[i][0]): descendants.append(listeparentes[i][1]) return (descendants)For example, with the values listed in the table, the program must return me
SURNAME1 SURNAME2I was thinking about something like that.. but that's not correct..
def ValueToSurname(name): name = [] for i in descendants: name.append(liste[i][1]) return (name)Thanks if you could help me :)