In a family tree each person is a dict: name is their name and kids is a list of their children (dicts just like this). Write generations(person): how many generations from this person down. Someone with no children is 1 generation.
generations({"name": "Gran", "kids": [{"name": "Mum", "kids": [{"name": "Lu", "kids": []}]}, {"name": "Tom", "kids": []}]})→3generations({"name": "Pip", "kids": []})→1def generations(person):
deepest = 0
for kid in person["kids"]:
# your code here: ask how many generations this kid has, and keep the biggest
pass
return 1 + deepest
Run tries the examples. When they look right, Submit.