Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class TreeNode(object):
- def __init__(self, x):
- self.val = x
- self.left = None
- self.right = None
- T= TreeNode(5)
- T.left = TreeNode(2)
- T.right = TreeNode(7)
- ans = T and T.left #===> This returns T.left, <--------- how?
- ans2 = T or T.left #===> This returns T . <-------------?
Add Comment
Please, Sign In to add comment