adventjs-issues
adventjs-issues copied to clipboard
Reto #24: Python - Da error en lectura de diccionarios
Al momento de ejecutar este código en una consola de python, se ejecuta sin problemas, pero lamentablemente, acá da errores.
Adjunto código y evidencia del mismo.
def is_trees_synchronized(tree1, tree2):
def are_mirrors(tree1, tree2):
if tree1 is None and tree2 is None:
return True;
if tree1 is None or tree2 is None:
return False;
return tree1.get('value') == tree2.get('value') and \
are_mirrors(tree1.get('left'), tree2.get('right')) and \
are_mirrors(tree1.get('right'), tree2.get('left'))
return [are_mirrors(tree1, tree2), tree1.get('value')]