Created
October 27, 2021 22:49
-
-
Save abhijeet-talaulikar/ca6e9a31a959f855988098e08def78e0 to your computer and use it in GitHub Desktop.
tree_contains_node.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def tree_contains_node(name, parent, fp_tree): | |
for node in fp_tree: | |
if (node['name'] == name) and (node['parent'] is parent): | |
return node | |
return False |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment