adventjs-issues icon indicating copy to clipboard operation
adventjs-issues copied to clipboard

Reto #24: Python - Da error en lectura de diccionarios

Open jlmasson opened this issue 10 months ago • 0 comments

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')]
image

jlmasson avatar Dec 24 '24 18:12 jlmasson