Jan-14-2018, 07:56 AM
[FOR FUN]
Hello everyone, I had the idea yesterday to improve my program (genealogical tree) which currently displays on the screen the ascendants, descendants, frere/sister of a person indicated in parameter.
Unfortunately this idea did not bear fruit as I find it a bit complex level of verification.
My ascendants program :
Thanks for fun :)
Hello everyone, I had the idea yesterday to improve my program (genealogical tree) which currently displays on the screen the ascendants, descendants, frere/sister of a person indicated in parameter.
Unfortunately this idea did not bear fruit as I find it a bit complex level of verification.
My ascendants program :
def ascendant(num3): ascendants = [] for i in range(len(listeparentes)): if (num3 == listeparentes[i][1]): ascendants.append(listeparentes[i][0]) return (ascendants)My descendant program :
def descendants(num3): descendants = [] for i in range(len(listeparentes)): if (num3 == listeparentes[i][0]): descendants.append(listeparentes[i][1]) return (descendants)I call them with :
def selectionnumero(nom, prenom): for i in range(len(listepersonnes)): if (nom == listepersonnes[i][0]) and (prenom == listepersonnes[i][1]): return (i)
nomchoix = input("\033[31mSaisir le Nom : \033[0m") prenomchoix = input("\033[31mSaisir le Prenom : \033[0m") num1 = selectionnumero(nomchoix, prenomchoix) print("\033[31mLes descendants connus de",nomchoix, prenomchoix, "sont : \033[0m")Actually , it's confused :
def grandparents(grandparents): grandparents = [] for i in range(len(listeparentes)): if ((Ascendants[0] == listeparentes[i][0]) or (Ascendants[1] == listeparentes[i][0])) and .... ))The idea is to ask for the seizure of a person as usual and to display the name of his grandfather if he has one and to show that he does not have one if he does not.
Thanks for fun :)