python data structures tree represents the nodes connected by edges it is non-linear data structure it has the following propertiesone node is marked as root node every node other than the root is associated with one parent node each node can have an arbitrary number of chid node we create tree data structure in python by using the concept of node discussed earlier we designate one node as root node and then add more nodes as child nodes below is program to create the root node create root we just create node class and add assign value to the node this becomes tree with only root node class nodedef __init__(selfdata)self left none self right none self data data def printtree(self)print(self dataroot node( root printtree(when the above code is executedit produces the following result