I have this dictionary that has a list of names ([child],[parent]). I need help finding whether two or more names, have a ancestor. If they do, then the function should return the single person that is closely related to everyone in the argument input.
Family_tree = {
'Steven': 'Mike', 'Josh': 'Mike',
'Mike': 'Jackson', 'Jackson': 'Greg',
'Drake': 'Bob', 'Greg': 'Calvin',
'Bob': 'Greg', 'Nathalie':'Amber',
'Amber': 'Jodie', 'Jodie': 'Calvin',
'Erick': 'Vincent', 'Vincent': 'Jodie',
'Emily': 'Sherri', 'Sherri': 'Jodie',
'Keagan': 'Sherri'}
This is what I have so far, but I do not know what to do next. Could anyone direct me to a post that is similar to this?
def ancestors(names , Family_tree)
common = ''
for itr in range(0,len(Family_tree)):
I am not going to pry for a answer, but If you do decide to give one that would be great! Just please be detailed on what you did, so I can improve.
Also, please tell me if this post doesn't make sense. I'll try to explain it better.