Create Tree From Array Python Definition