# Binary tree node
class node:
def __init__(self, data):
self.left=None
self.right=None
self.data=data
# Function to create a new
# Binary node
def newNode(data):
return node(data)
def t():
root=newNode("A")
root.left = newNode("B")
root.right = newNode("C")
root.left.left = newNode("D")
root.left.right = newNode("G")
root.right.right = newNode("E")
root.right.right.left = newNode("F")
print(t)
Hi, I have tried to create a Binary Tree above but I did not managed to print out the binary tree when I print "t".
Instead of a Binary Tree, it shows me this: