https://github.com/codebasics/data-structures-algorithms-python/blob/6b8a49504c5e5d3b9c65335559904963550ffc6b/data_structures/9_Binary_Tree_2/Exercise/binary_tree_part_2_exercise.py#L64 If self.right is None: return self.left #64 line