GfG QA is closing soon... Please refer PRACTICE or GfG now on wards !!

Python function help | Willing to pay [closed]

Since im new with python (learning now) i got idea to make function which tells how far the descendant is from the given person.

I mean like that, you have family tree and script (checkif(person, descendant)) check if descendant is same person than it returns 0.

If the descendant is the child of a person, it returns 1. If (s)he's a grandchild, it returns 2. If (s)he's a grandgrandchild, it returns 3

How do i made this?

Here is example of family tree that i made (names are in slovenian language) in brackets is age of person:

Thanks for any kind of help

closed with the note: Already have answer
asked Dec 13, 2016 by faca
closed Dec 13, 2016