Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
jlmasson opened this issue Dec 24, 2024 · 0 comments
Open

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

jlmasson opened this issue Dec 24, 2024 · 0 comments

Comments

@jlmasson
Copy link

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant