Create family_tree.py

Экзаменационное задание по семейному дереву вида https://courses.edx.org/c4x/MITx/6.00.1x/asset/images_familyTree.png .

Family trees have been around for a long time, even before computers were invented. The parents formed the root at the top, and below were their children, then grandchildren, and so on.

There are special words for parents, grandparents, uncles, aunts, and more. Below is a family tree, with "A" as the founding ancestor.



Click on the above image to see it at full size.

In this problem, we'll use the general term "cousin" as follows:

zeroth cousin: If two nodes are siblings (have the same immediately preceding ancestor, such as nodes "H" and "I") they are zeroth cousins.
first cousin: Children of zeroth cousins are first cousins.
second cousin: Grandchildren of zeroth cousins are second cousins.
In general, i'th cousins have a grandparent or ancestor that is i levels up from their parents.

Family trees have been around for a long time, even before computers were invented. The parents formed the root at the top, and below were their children, then grandchildren, and so on.

There are special words for parents, grandparents, uncles, aunts, and more. Below is a family tree, with "A" as the founding ancestor.



Click on the above image to see it at full size.

In this problem, we'll use the general term "cousin" as follows:

zeroth cousin: If two nodes are siblings (have the same immediately preceding ancestor, such as nodes "H" and "I") they are zeroth cousins.
first cousin: Children of zeroth cousins are first cousins.
second cousin: Grandchildren of zeroth cousins are second cousins.
In general, i'th cousins have a grandparent or ancestor that is i levels up from their parents.